dsa3 min read
Integer Overflow, Precision, and Safe Arithmetic
Prevent integer overflow in competitive programming: safe multiplication, __int128, binary search on answers, and floating-point gotchas.
Read →
webcoderspeed.com
1276 articles
Prevent integer overflow in competitive programming: safe multiplication, __int128, binary search on answers, and floating-point gotchas.
Build range query structures in O(sqrt n) per query with block decomposition. Simpler alternative to segment trees.
Solve systems of modular congruences with the Chinese Remainder Theorem. Fundamental for cryptography and competitive math.
Explore classic number sequences: Fibonacci, Lucas, Pell, tribonacci, with DP and matrix approaches.
Master bitwise operations for DSA: XOR tricks, Brian Kernighan bit counting, subset enumeration, and bitmask DP.