Concepts2
⚙️AlgorithmIntermediate
Overflow Prevention Techniques
Integer overflow happens when a computed value exceeds the range of its type; in C++ this silently wraps for unsigned and is undefined for signed, so prevention is crucial.
#overflow prevention#long long#__int128+11
⚙️AlgorithmIntermediate
Matrix Exponentiation
Matrix exponentiation turns repeated linear transitions into a single fast power of a matrix using exponentiation by squaring.
#matrix exponentiation#binary exponentiation#companion matrix+11