Skip to content
Minimalist implementations of algorithms widely used in competitive programming
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
aho_corasick.cpp
alcotree.cpp code style May 24, 2018
bfs.cpp
burnside.cpp code style May 24, 2018
centroid.cpp not sure if it works May 24, 2018
checker.py Moar random generators Mar 13, 2017
cnk.cpp
compress.cpp code style May 24, 2018
dijkstra.cpp code style May 24, 2018
dp_dnc.cpp
dsu.cpp
fenwick.cpp code style May 24, 2018
fft.cpp
gauss.cpp code style May 24, 2018
gcd.cpp code style May 24, 2018
geometry.cpp code style May 24, 2018
hashmap.cpp Bugfix Mar 22, 2018
hld.cpp code style May 24, 2018
kuhn.cpp V Mar 9, 2019
lca.cpp code style May 24, 2018
manacher.cpp
maxflow_ffa.cpp
mincost_maxflow.cpp code style May 24, 2018
palindromic_tree.cpp
persistent_treap.cpp
prefix_function.cpp Added prefix function Nov 21, 2018
radix_sort.cpp code style May 24, 2018
segtree.cpp
segtree_dynamic.cpp code style Mar 20, 2018
sparse.cpp
suffix_array.cpp
suffix_automaton.cpp
treap.cpp treap split May 24, 2018
z_function.cpp

README.md

algo

The snippets you are asked to code way too often in competitive programming.

Code is intentionally simplified (no references, templates, inheritance, try-catches or stuff like that) so that you do not need to read a 300 pages long book to understand it. You are supposed to just copy and paste it during contest with minimal changes.

Use at your own risk. I am pretty sure it at least compiles, but may contain minor bugs.

Pull requests are welcome, since I do not do contests so actively anymore.

TODO:

  • convex hull (!)
  • half-plane intersection
  • dinic's algorithm
  • long arithmetic
  • bridge finding (!)
  • minimum spanning tree
  • sqrt decomposition (!!)
  • string hashing
  • kth element in O(n)
  • bitset Gauss, bitset matmul (!)
  • better FFT or fast Karatsuba
  • persiistent data structures (!!)
  • dynamic connectivity (!)
You can’t perform that action at this time.