Concepts3
∑MathAdvanced
Floor Sum Formula
The floor sum computes S(n,m,a,b) = sum_{i=0}^{n-1} floor((a i + b)/m) efficiently in O(log(min(a,m))) time.
#floor sum#atcoder library#euclidean algorithm+12
⚙️AlgorithmAdvanced
Matrix Exponentiation - Advanced
Matrix exponentiation turns repeated linear transitions into fast O(n^{3} log k) computation using exponentiation by squaring.
#matrix exponentiation#adjacency matrix#walk counting+12
🗂️Data StructureAdvanced
Segment Tree - Handling Multiple Lazy Operations
When a segment tree supports multiple range updates, you must define how lazy tags compose, because the order of operations matters and composition is not commutative.
#segment tree#lazy propagation#range add+12