An ordered path through this wiki. Each stage assumes the previous one is comfortable, not merely read.
The rule that matters
A topic is learned when you can re-implement it from an empty file and debug it under time pressure. Reading a page is the start of learning it, never the end.
Stage 0 — Prerequisites
- A language: C++ for contests (see C++ Tips and STL Containers)
- Complexity analysis — reading constraints to infer the intended complexity
- Fast I/O
Checkpoint: you can read and immediately think "".
Stage 1 — Foundations
| Topic | Pages |
|---|---|
| Sorting and searching | Binary Search, Binary Search on Answer, Merge Sort |
| Two pointers and sliding window | Two Pointers, Sliding Window |
| Prefix sums | Prefix Sums, Difference Arrays |
| Arrays in place | Array and Matrix Techniques |
| Basic greedy | Greedy and Scheduling |
| Recursion and backtracking | Backtracking |
Practice: CSES Introductory Problems and Sorting and Searching. Codeforces Div 3 A–C.
Stage 2 — Core techniques
| Topic | Pages |
|---|---|
| Graph traversal | BFS, DFS, Components, Toposort |
| Shortest paths | Dijkstra, Shortest Paths, Floyd-Warshall |
| Basic DP | DP — knapsack, LIS, edit distance |
| Number theory | Sieve, Modular Arithmetic, GCD |
| Basic structures | DSU, Fenwick, Segment Tree |
Practice: CSES Graph Algorithms, Dynamic Programming, Range Queries. Codeforces Div 2 A–C.
Stage 3 — Intermediate
| Topic | Pages |
|---|---|
| Trees | LCA, HLD, Tree DP, Rerooting |
| Flows and matching | Max Flow, Hopcroft-Karp, Hungarian |
| Strings | KMP, Z-function, Hashing, Trie |
| Combinatorics | Combinatorics, Inclusion-Exclusion, Probability |
| Bit tricks | Bit Manipulation, SOS DP |
| Advanced DP | Bitmask, Digit, DP Cheatsheet |
Practice: Codeforces Div 2 C–D, AtCoder ABC E–F.
Stage 4 — Advanced
| Topic | Pages |
|---|---|
| Segment tree variants | Lazy, Persistent, Beats, Li Chao |
| Decompositions | Sqrt, Mo’s, Centroid, Small-to-Large |
| Suffix structures | Suffix Automaton, Suffix Array, Aho-Corasick |
| Polynomials | FFT, Polynomial Algebra |
| Geometry | Computational Geometry, Convex Hull |
| Game theory | Sprague-Grundy and friends |
Practice: Codeforces Div 1 A–C, AtCoder ARC.
Stage 5 — Specialist
Link-Cut Trees · Wavelet Trees · Blossom · MCMF · Berlekamp-Massey · Exact Exponential Algorithms · Randomized and Approximation
Reach for these when a problem demands them, not before.
What to skip until it appears
Fürer’s multiplication, Chazelle’s linear MST, most curiosities, and anything whose constant factor makes it slower than the simple version at contest sizes. Knowing that a bound exists is enough; implementing it is not.
See also: Navigation · Problem Sets · Online Judges · Master Checklist