CP Notes is a personal competitive programming knowledge base for Codeforces, ICPC and IOI. It aims to cover everything from C++ basics to advanced data structures, with theory, proofs, implementations and practice problems for every topic.
Author

whoashish115 β GitHub Β· whoashish.com
Links
- Notes repository: github.com/whoashish115/cp-notes
- Templates repository: github.com/whoashish115/cp-template (see Templates)
- Website: hypercube-notes.vercel.app
Organisation
- 25 topic folders in learning order, plus Miscellaneous for material outside core contest work (complexity theory, puzzles, rarely-implemented algorithms).
- Every folder has an index listing its notes in order. The Home page lists everything.
- Named algorithms live inside their topic (Dijkstra under Shortest Paths, KMP under String Matching).
- Each note covers the idea, then the algorithm, complexity, implementation, pitfalls and problems. Some notes also include handbook notes, handwritten PDF notes and practice write-ups.
Conventions
- Titles use full names (Dynamic Programming, Lowest Common Ancestor). Inside notes, standard short forms are used. See Abbreviations.
- Code is C++20 with aliases
i64 = long long,u64,i128 = __int128,ld = long double. - Indices are 0-based and ranges half-open
[l, r)unless a note says otherwise. - Formulas are collected in the Formula.
Credits
These notes were built with the help of the following people and resources.
These notes were built from many excellent sources. Huge thanks to all of them.
Notes and Courses
- Yash Poonia β CP notes (GCD, harmonic numbers, Euler tour, bit manipulation, maths and DP write-ups in Problem Write-ups)
- codestorywithMIK β DSA explanations
- TLE Eliminators β CP course
- Striver A2Z DSA Sheet β DSA roadmap
- CSLadder β problem ladders
Problem Sets and Guides
- CSES Problem Set β https://cses.fi/problemset/
- USACO Guide β https://usaco.guide/
- cp-algorithms β https://cp-algorithms.com/
- KACTL β https://github.com/kth-competitive-programming/kactl
Books
- Competitive Programmerβs Handbook β Antti Laaksonen (chapter notes in CP Handbook)