Skip to content
sujaykondaPublic

About

Competitive Programming Library

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cplib – Competitive Programming Library

License: MIT

cplib is a lightweight, modular C++ library designed to accelerate competitive programming by providing efficient implementations of commonly used algorithms, data structures, and utilities. It is organized for easy use and quick integration into contest solutions.

Features

  • Modular Structure: Organized into headers for data structures, graph algorithms, math utilities, string algorithms, and more.
  • Single-file Expansion: Use exp.py to merge all required headers into a single file for easy submission.
  • Optimized Implementations: Fast and reliable code for typical competitive programming tasks.
  • Easy Integration: Just include the relevant headers or expand to a single file for contests.

Directory Structure

  • general.h: General utilities and template helpers.
  • random.h: Random number generators.
  • bs.h: Binary search utilities.
  • gen.h: Code generation utilities.
  • exp.py: Python script for single-file expansion.

Subdirectories

  • ds/: Data structures (BIT, segment trees, sparse tables, etc.)
  • graph/: Graph algorithms (DSU, flows, SCC, trees, etc.)
  • math/: Math utilities (modular arithmetic, geometry, hashing, polynomials, etc.)
  • strings/: String algorithms (matching, suffix arrays, etc.)

Usage

1. Direct Include

Include the required header(s) in your C++ solution:

#include <cplib/general.h>
#include <cplib/ds/bit.h>
#include <cplib/graph/flow.h>

2. Single-file Expansion (Recommended for Contests)

Use exp.py to generate a single cpp file (submit.cpp) containing all dependencies to submit to your online judge:

python3 exp.py merged.cpp

License

This library is released under the MIT License

About

Competitive Programming Library

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages