Advanced · Free course
Competitive Programming
Contest techniques in C++ with stress tests and real constraints.
90 lessons32 videos so far6 h 27 min of videoNotes for every lesson
What you’ll learn
- Fast I/O and complexity
- Number theory and combinatorics
- Graphs and trees for contests
- Advanced DP and data structures
0 of 90 complete
Curriculum
- 1What competitive programming is: contests, judges, verdicts, ratingssoon
- 2C++ setup for contests: template, fast I/O, bits/stdc++soon
- 3Reading constraints: from n to the complexity you needsoon
- 4Verdicts explained: WA, TLE, MLE, RE and how to debug eachsoon
- 5Stress testing: brute force + random generator + checkersoon
- 6Contest strategy: reading order, time, penalties, upsolving10 min
- 7Prefix sums and difference arrays11 min
- 82D prefix sums and range updates10 min
- 9Coordinate compression11 min
- 10Two pointers on contest problems10 min
- 11Binary search on the answersoon
- 12Ternary search10 min
- 13Sorting tricks and custom comparators13 min
- 14Greedy with exchange-argument proofssoon
- 15Constructive problems: build any valid answer11 min
- 16Ad-hoc and observation problems12 min
- 17Bit tricks: XOR properties, masks, __builtin functions13 min
- 18Meet in the middle10 min
- 19Number theory 1: divisibility, GCD/LCM, the Euclidean algorithm14 min
- 20Number theory 2: sieve, smallest prime factor, factorisation12 min
- 21Modular arithmetic and fast exponentiation11 min
- 22Modular inverse and Fermat's little theorem13 min
- 23Combinatorics: nCr mod p with factorials15 min
- 24Inclusion-exclusion14 min
- 25Extended Euclid and linear Diophantine equations16 min
- 26Chinese remainder theorem15 min
- 27Euler's totient and divisor sums19 min
- 28Probability and expected value18 min
- 29Matrix exponentiation for linear recurrences13 min
- 30Game theory 1: winning and losing positions11 min
- 31Game theory 2: Nim and Sprague-Grundy11 min
- 32DP for contests 1: states and transitions11 min
- 33DP 2: knapsack variants12 min
- 34DP 3: DP on subsequences and strings11 min
- 35DP 4: interval DP10 min
- 36DP 5: bitmask DP10 min
- 37DP 6: digit DP10 min
- 38DP 7: DP on trees and rerooting10 min
- 39DP 8: SOS DP (sum over subsets)10 min
- 40DP 9: probability and expected-value DPsoon
- 41DP optimisation 1: monotonic queue and prefix-min trickssoon
- 42DP optimisation 2: convex hull tricksoon
- 43DP optimisation 3: divide and conquer DPsoon
- 44DP optimisation 4: Knuth optimisationsoon
- 45Graphs for contests: BFS/DFS templates, grids, 0-1 BFSsoon
- 46Shortest paths in contests: Dijkstra variants, multi-source, state graphssoon
- 47DSU with rollback and small-to-large mergingsoon
- 48Minimum spanning tree problemssoon
- 49Topological order and DP on DAGssoon
- 50Bridges, articulation points and 2-edge-connected componentssoon
- 51SCC and 2-SATsoon
- 52Trees: diameter, centre, subtree sizessoon
- 53LCA with binary liftingsoon
- 54Euler tour and subtree queriessoon
- 55Heavy-light decompositionsoon
- 56Centroid decompositionsoon
- 57Functional graphs and cycle findingsoon
- 58Max flow: Dinic's algorithmsoon
- 59Bipartite matching and König's theoremsoon
- 60Min-cost max-flowsoon
- 61Segment tree with lazy propagationsoon
- 62Segment tree beats and merging trickssoon
- 63Fenwick tree tricks: range update, order statisticssoon
- 64Sparse table and RMQ on contestssoon
- 65Sqrt decompositionsoon
- 66Mo's algorithmsoon
- 67Persistent segment treesoon
- 68Ordered set (policy-based data structures)soon
- 69Treap: split and mergesoon
- 70Monotonic stack and deque in contest problemssoon
- 71String hashing (and anti-hash tests)soon
- 72KMP and prefix-function problemssoon
- 73Z-function problemssoon
- 74Manacher's algorithmsoon
- 75Trie and XOR-maximisation problemssoon
- 76Aho-Corasicksoon
- 77Suffix array and LCPsoon
- 78Suffix automaton basicssoon
- 79Geometry 1: points, vectors, cross product, orientationsoon
- 80Geometry 2: convex hullsoon
- 81Geometry 3: line intersection and polygon areasoon
- 82FFT and polynomial multiplicationsoon
- 83NTT and counting with polynomialssoon
- 84Interactive problemssoon
- 85Random and hashing techniques in contestssoon
- 86Bitsets for speedsoon
- 87Contest walkthrough: a Div 2 A-C setsoon
- 88Contest walkthrough: a Div 2 D-E setsoon
- 89Contest walkthrough: a hard Div 1 setsoon
- 90The road from Pupil to Expert and beyond: practice plansoon