Here you will find implementation of algorithms and data structures used in competitive programming context, submissions to many OJ problems, and printable notebook with the implementations
-
Data Structures
- Segtree Lazy (Atcoder)
- bitree
- bitree 2d
- convex hull trick
- disjoint sparse table
- dsu
- lichao tree dynamic
- merge sort tree
- ordered set gnu pbds
- prefix sum 2d
- segtree PA
- segtree pud rqd
- segtree rmaxq pmaxu (dynamic)
- segtree rmaxq rmaxu
- segtree rminq pau
- segtree rminq rsu
- segtree rsq psu (dynamic)
- segtree rsq rsu
- segtree rxorq pau
- sparse table
-
Dynamic Programming
-
Extras
-
Geometry
-
Graphs
- 2 SAT
- Cycle Distances
- SCC (struct)
- bellman ford
- bellman ford (find negative cycle)
- bfs 01
- biconnected components
- binary lifting
- block cut tree
- check bipartite
- dijkstra (k shortest paths)
- dijkstra (restore path)
- disjoint edge paths (maxflow)
- euler path (directed)
- euler path (undirected)
- extra edges to make digraph fully strongly connected
- find articulation points
- find bridge tree components
- find bridges
- find bridges (online)
- find centroid
- floyd warshall
- functional graph
- graph cycle (directed)
- graph cycle (undirected)
- heavy light decomposition
- kruskal
- lowest common ancestor (binary lifting)
- lowest common ancestor sparse table
- maximum flow (dinic)
- maximum flow (edmonds karp)
- minimum cost flow
- minimum cut (unweighted)
- prim
- small to large
- successor graph (struct)
- sum every node distance
- topological labelling (kahn)
- topological sorting (kahn)
- topological sorting (tarjan)
- tree diameter (dp)
- tree flatten
- tree isomorphism (not rooted)
- tree isomorphism (rooted)
- tree maximum distances
-
Math
- GCD
- GCD using factorization
- LCM
- LCM using factorization
- arithmetic progression sum
- binomial
- binomial mod
- chinese remainder theorem
- derangement
- euler phi
- euler phi (in range)
- factorial
- factorial factorization
- factorization
- factorization (Pollard)
- fast pow
- fft convolution
- find multiplicative inverse
- find solution diophantine equation
- gauss elimination
- integer mod
- integer partition
- matrix exponentiation
- n elements choose k
- ntt int convolution and exp
- ntt int convolution two mods
- number of divisors
- number of divisors (sieve)
- power sum
- sieve list primes
- sum of divisors
- to any base
-
Primitives
-
Searching
-
Strings
- kattis
- atCoder
- Usaco
- Neps
- leetCode
- CSES
- OBI
- [Library Checker](/submissions/Library Checker)
- maratonasDF unballoon
- Becrowd
- Meta Hacker Cup
- SPOJ sphere
- moj
- CodeChef
- UVA OJ
- Codeforces
- ICPC