Concepts19
Fast Exponentiation
Fast exponentiation (binary exponentiation) computes a^n using repeated squaring in O(log n) multiplications.
Chinese Remainder Theorem
The Chinese Remainder Theorem (CRT) reconstructs an integer from its remainders modulo pairwise coprime moduli and guarantees a unique answer modulo the product.
NTT (Number Theoretic Transform)
The Number Theoretic Transform (NTT) is an FFT-like algorithm that performs discrete convolutions exactly using modular arithmetic instead of floating-point numbers.
String Hashing (Polynomial Hash)
Polynomial string hashing encodes a string as a base-p number modulo a large prime, letting us compare substrings in O(1) after O(n) preprocessing.
Linear Recurrence
A linear recurrence defines each term as a fixed linear combination of a small, fixed number of previous terms.
Aho-Corasick - DP Applications
AhoβCorasick (AC) turns a set of forbidden patterns into a finite automaton that lets you process or generate strings while tracking whether any pattern appears.
DSU with Weighted Edges
A DSU with weighted edges (also called a potential or difference-constraint union-find) maintains relative values between elements while still supporting near-constant-time merges and finds.