This repository contains standalone implementations of algorithms and data structures commonly used in programming contests.
All source files live in the repository root. They are grouped below for convenience.
- add_min_segment_tree.hpp
- add_numbers_seg_tree.cpp
- bitset.hpp
- convex_hull_trick.hpp
- convex_hull_trick_cartesian.hpp
- dynamic_convex_hull_trick.hpp
- fenwick.hpp
- hash_map.cpp
- hll.hpp
- implicit_treap.hpp
- persistent_cartesian.hpp
- queue_min.hpp
- segment_tree_interval_modification.hpp
- sqrt_reverse_segments.cpp
- sqrt_sum_query.hpp
- 2sat.hpp
- _2sat.cpp
- centroid_decomposition.hpp
- dinic.hpp
- dominator_tree.hpp
- dynamic_connectivity.cpp
- dynamic_connectivity_memory_optimized.cpp
- euler_tour_link_cut.hpp
- fast_kuhn.cpp
- heavy_light_decomposition.hpp
- heavy_light_non_recursive.hpp
- hopcroft_karp.cpp
- min_cost_flow_potentials.cpp
- two_chinese.hpp
- berlekamp_massey.hpp
- binomial_prime_power.hpp
- compile_time_primes.hpp
- factor.hpp
- fast_divider.hpp
- fft_arbitrary_mod.hpp
- find_recurrence_relation.cpp
- karatsuba.hpp
- linear_inequality_count.hpp
- log_num.hpp
- matrix_multiplication.hpp
- miller_rabin.hpp
- mobius_gcd.cpp
- modular_class.cpp
- ntt.hpp
- poly_gcd.cpp
- poly_inverse.hpp
- prime_count.hpp
- subset_convolution.hpp
- sum_and_count_primes.cpp
- xor_convolution.hpp
- aho_corasick_occurences.cpp
- dfa.hpp
- hash_suffixes.hpp
- palindromic_tree.hpp
- suffix_array_tree.cpp
- suffixtree_sa.cpp
- arithmeticprog.cpp
- bin_search.hpp
- convex_hull.hpp
- convex_hull_dbl.hpp
- fast_input.hpp
- smart_pointer.hpp
The test directory contains simplified test versions of some snippets.
Each file is self‑contained. Copy the desired snippet into your project or include it directly when solving problems.