Skip to content

About

Collection of competitive programming templates, algorithms, and data structures in C++

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

CP Code Library

A curated collection of competitive programming templates, algorithms, and data structures in C++ — used in contests and practice.

Directory Structure

Resources/
├── Templates/              # Self-contained algorithm template files
├── Bits/                   # Bit manipulation algorithms
├── Data Structures/         # Segment Tree, BIT, DSU, Trie, Sparse Table, etc.
├── Dynamic Programming/     # DP algorithms (Digit DP, SOS DP, CHT, etc.)
├── Geometry/               # Geometric algorithms and formulas
├── Graph/                  # Graph algorithms (SCC, LCA, HLD, Flow, etc.)
├── Math/                   # Mathematics (FFT, combinatorics, matrices, etc.)
├── Number Theory/          # Number theory (sieves, modular arithmetic, etc.)
├── Others/                 # Miscellaneous utilities and notes
├── String/                 # String algorithms (KMP, Z, Hashing, Suffix Array, etc.)
├── Tricks/                 # Algorithmic tricks and techniques
├── Unsolved_Problems/      # Practice problem tracker
├── References/             # External competitive programming libraries
│   ├── kactl/              # KTH ACM Contest Template Library
│   ├── cp-reference/       # CP Reference by zhtluo
│   ├── Effervescent_Code_Library/
│   └── icpc-teamnote/      # ICPC Team Note by justiceHui
└── Tools/                  # Utilities and references
    ├── debug-tips.txt      # Debugging and optimization tips
    └── stl-ref.txt         # C++ STL quick reference

Usage

Each file in Templates/ is self-contained. Include the relevant header or copy the template into your solution.

#include "Templates/segtree.cpp"

License

Feel free to use these in contests and personal practice.

About

Collection of competitive programming templates, algorithms, and data structures in C++

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages