├── README.md ├── bignum_fft ├── bignum_fft.cc └── ntt.cc ├── bits ├── iterate_bitmasks_with_popcount.cc ├── iterate_submasks.cc ├── iterate_supermasks.cc ├── submask_sums.cc ├── subset_convolution.cc └── xor_basis.cc ├── bst ├── online_prefix_max.cc ├── orderset-pbds.cc ├── splay_lazy.cc └── splay_tree.cc ├── div_conquer └── count_pairs.cc ├── dp ├── distinct_subsequences.cc └── longest_common_subsequence.cc ├── euler_tour └── tree_sum_DS.cc ├── flow ├── assignment_problem_flow.cc ├── dinic.cc ├── dinic_matching.cc ├── max_weight_closure.cc ├── min_cost_flow.cc └── projects_and_tools.cc ├── geometry ├── dp_hull.cc ├── manhattan_mst.cc ├── monotonic_dp_hull_deque.cc ├── online_hull.cc └── point.cc ├── graph_theory ├── biconnected_components.cc ├── bridges.cc ├── check_bipartite.cc └── topological_sort.cc ├── hash ├── array_hash.cc └── string_hash.cc ├── heavy_light └── subtree_heavy_light.cc ├── io └── io.cc ├── miscellaneous ├── closest_left_right.cc ├── compress_array.cc ├── float_matrix.cc ├── floor_div_ceil_div.cc ├── highest_bit.cc ├── output_vector.cc └── radix_sort.cc ├── mod ├── barrett_int.cc ├── chinese_remainder_theorem.cc ├── choose.cc ├── mod_int.cc ├── mod_int_simple.cc └── mod_matrix.cc ├── number_theory ├── fraction.cc ├── miller_rabin.cc ├── sieve_factor.cc └── sieve_linear.cc ├── rmq_lca ├── block_rmq_mask.cc ├── cartesian_tree_parent_only.cc ├── monotonic_rmq_deque.cc ├── rmq_lca.cc └── weighted_lca.cc ├── scc_two_sat └── scc_two_sat.cc ├── seg_tree ├── basic_seg_tree.cc ├── fenwick_tree.cc ├── iterative_seg_tree.cc ├── persistent_array.cc ├── persistent_basic_seg_tree.cc ├── persistent_seg_tree.cc ├── seg_tree.cc └── seg_tree_beats.cc ├── shortest_path ├── bfs.cc ├── dijkstra.cc └── grid_bfs.cc ├── sqrt ├── mo.cc └── search_buckets.cc ├── strings ├── aho_corasick.cc ├── edit_distance.cc ├── kmp.cc ├── suffix_array.cc ├── trie.cc └── z_algorithm.cc ├── tree_centroid ├── basic_template.cc ├── subtract_subtrees_template.cc └── subtree_prefixes_template.cc ├── tree_dp ├── arrays_template_linear.cc ├── arrays_template_quadratic.cc ├── basic_template.cc └── up_down_tree_dp.cc └── union_find ├── bipartite_union_find.cc ├── kruskal.cc └── union_find_size.cc /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/README.md -------------------------------------------------------------------------------- /bignum_fft/bignum_fft.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bignum_fft/bignum_fft.cc -------------------------------------------------------------------------------- /bignum_fft/ntt.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bignum_fft/ntt.cc -------------------------------------------------------------------------------- /bits/iterate_bitmasks_with_popcount.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bits/iterate_bitmasks_with_popcount.cc -------------------------------------------------------------------------------- /bits/iterate_submasks.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bits/iterate_submasks.cc -------------------------------------------------------------------------------- /bits/iterate_supermasks.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bits/iterate_supermasks.cc -------------------------------------------------------------------------------- /bits/submask_sums.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bits/submask_sums.cc -------------------------------------------------------------------------------- /bits/subset_convolution.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bits/subset_convolution.cc -------------------------------------------------------------------------------- /bits/xor_basis.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bits/xor_basis.cc -------------------------------------------------------------------------------- /bst/online_prefix_max.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bst/online_prefix_max.cc -------------------------------------------------------------------------------- /bst/orderset-pbds.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bst/orderset-pbds.cc -------------------------------------------------------------------------------- /bst/splay_lazy.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bst/splay_lazy.cc -------------------------------------------------------------------------------- /bst/splay_tree.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/bst/splay_tree.cc -------------------------------------------------------------------------------- /div_conquer/count_pairs.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/div_conquer/count_pairs.cc -------------------------------------------------------------------------------- /dp/distinct_subsequences.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/dp/distinct_subsequences.cc -------------------------------------------------------------------------------- /dp/longest_common_subsequence.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/dp/longest_common_subsequence.cc -------------------------------------------------------------------------------- /euler_tour/tree_sum_DS.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/euler_tour/tree_sum_DS.cc -------------------------------------------------------------------------------- /flow/assignment_problem_flow.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/flow/assignment_problem_flow.cc -------------------------------------------------------------------------------- /flow/dinic.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/flow/dinic.cc -------------------------------------------------------------------------------- /flow/dinic_matching.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/flow/dinic_matching.cc -------------------------------------------------------------------------------- /flow/max_weight_closure.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/flow/max_weight_closure.cc -------------------------------------------------------------------------------- /flow/min_cost_flow.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/flow/min_cost_flow.cc -------------------------------------------------------------------------------- /flow/projects_and_tools.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/flow/projects_and_tools.cc -------------------------------------------------------------------------------- /geometry/dp_hull.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/geometry/dp_hull.cc -------------------------------------------------------------------------------- /geometry/manhattan_mst.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/geometry/manhattan_mst.cc -------------------------------------------------------------------------------- /geometry/monotonic_dp_hull_deque.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/geometry/monotonic_dp_hull_deque.cc -------------------------------------------------------------------------------- /geometry/online_hull.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/geometry/online_hull.cc -------------------------------------------------------------------------------- /geometry/point.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/geometry/point.cc -------------------------------------------------------------------------------- /graph_theory/biconnected_components.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/graph_theory/biconnected_components.cc -------------------------------------------------------------------------------- /graph_theory/bridges.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/graph_theory/bridges.cc -------------------------------------------------------------------------------- /graph_theory/check_bipartite.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/graph_theory/check_bipartite.cc -------------------------------------------------------------------------------- /graph_theory/topological_sort.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/graph_theory/topological_sort.cc -------------------------------------------------------------------------------- /hash/array_hash.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/hash/array_hash.cc -------------------------------------------------------------------------------- /hash/string_hash.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/hash/string_hash.cc -------------------------------------------------------------------------------- /heavy_light/subtree_heavy_light.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/heavy_light/subtree_heavy_light.cc -------------------------------------------------------------------------------- /io/io.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/io/io.cc -------------------------------------------------------------------------------- /miscellaneous/closest_left_right.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/miscellaneous/closest_left_right.cc -------------------------------------------------------------------------------- /miscellaneous/compress_array.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/miscellaneous/compress_array.cc -------------------------------------------------------------------------------- /miscellaneous/float_matrix.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/miscellaneous/float_matrix.cc -------------------------------------------------------------------------------- /miscellaneous/floor_div_ceil_div.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/miscellaneous/floor_div_ceil_div.cc -------------------------------------------------------------------------------- /miscellaneous/highest_bit.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/miscellaneous/highest_bit.cc -------------------------------------------------------------------------------- /miscellaneous/output_vector.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/miscellaneous/output_vector.cc -------------------------------------------------------------------------------- /miscellaneous/radix_sort.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/miscellaneous/radix_sort.cc -------------------------------------------------------------------------------- /mod/barrett_int.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/mod/barrett_int.cc -------------------------------------------------------------------------------- /mod/chinese_remainder_theorem.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/mod/chinese_remainder_theorem.cc -------------------------------------------------------------------------------- /mod/choose.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/mod/choose.cc -------------------------------------------------------------------------------- /mod/mod_int.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/mod/mod_int.cc -------------------------------------------------------------------------------- /mod/mod_int_simple.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/mod/mod_int_simple.cc -------------------------------------------------------------------------------- /mod/mod_matrix.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/mod/mod_matrix.cc -------------------------------------------------------------------------------- /number_theory/fraction.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/number_theory/fraction.cc -------------------------------------------------------------------------------- /number_theory/miller_rabin.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/number_theory/miller_rabin.cc -------------------------------------------------------------------------------- /number_theory/sieve_factor.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/number_theory/sieve_factor.cc -------------------------------------------------------------------------------- /number_theory/sieve_linear.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/number_theory/sieve_linear.cc -------------------------------------------------------------------------------- /rmq_lca/block_rmq_mask.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/rmq_lca/block_rmq_mask.cc -------------------------------------------------------------------------------- /rmq_lca/cartesian_tree_parent_only.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/rmq_lca/cartesian_tree_parent_only.cc -------------------------------------------------------------------------------- /rmq_lca/monotonic_rmq_deque.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/rmq_lca/monotonic_rmq_deque.cc -------------------------------------------------------------------------------- /rmq_lca/rmq_lca.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/rmq_lca/rmq_lca.cc -------------------------------------------------------------------------------- /rmq_lca/weighted_lca.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/rmq_lca/weighted_lca.cc -------------------------------------------------------------------------------- /scc_two_sat/scc_two_sat.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/scc_two_sat/scc_two_sat.cc -------------------------------------------------------------------------------- /seg_tree/basic_seg_tree.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/seg_tree/basic_seg_tree.cc -------------------------------------------------------------------------------- /seg_tree/fenwick_tree.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/seg_tree/fenwick_tree.cc -------------------------------------------------------------------------------- /seg_tree/iterative_seg_tree.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/seg_tree/iterative_seg_tree.cc -------------------------------------------------------------------------------- /seg_tree/persistent_array.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/seg_tree/persistent_array.cc -------------------------------------------------------------------------------- /seg_tree/persistent_basic_seg_tree.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/seg_tree/persistent_basic_seg_tree.cc -------------------------------------------------------------------------------- /seg_tree/persistent_seg_tree.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/seg_tree/persistent_seg_tree.cc -------------------------------------------------------------------------------- /seg_tree/seg_tree.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/seg_tree/seg_tree.cc -------------------------------------------------------------------------------- /seg_tree/seg_tree_beats.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/seg_tree/seg_tree_beats.cc -------------------------------------------------------------------------------- /shortest_path/bfs.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/shortest_path/bfs.cc -------------------------------------------------------------------------------- /shortest_path/dijkstra.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/shortest_path/dijkstra.cc -------------------------------------------------------------------------------- /shortest_path/grid_bfs.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/shortest_path/grid_bfs.cc -------------------------------------------------------------------------------- /sqrt/mo.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/sqrt/mo.cc -------------------------------------------------------------------------------- /sqrt/search_buckets.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/sqrt/search_buckets.cc -------------------------------------------------------------------------------- /strings/aho_corasick.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/strings/aho_corasick.cc -------------------------------------------------------------------------------- /strings/edit_distance.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/strings/edit_distance.cc -------------------------------------------------------------------------------- /strings/kmp.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/strings/kmp.cc -------------------------------------------------------------------------------- /strings/suffix_array.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/strings/suffix_array.cc -------------------------------------------------------------------------------- /strings/trie.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/strings/trie.cc -------------------------------------------------------------------------------- /strings/z_algorithm.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/strings/z_algorithm.cc -------------------------------------------------------------------------------- /tree_centroid/basic_template.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/tree_centroid/basic_template.cc -------------------------------------------------------------------------------- /tree_centroid/subtract_subtrees_template.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/tree_centroid/subtract_subtrees_template.cc -------------------------------------------------------------------------------- /tree_centroid/subtree_prefixes_template.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/tree_centroid/subtree_prefixes_template.cc -------------------------------------------------------------------------------- /tree_dp/arrays_template_linear.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/tree_dp/arrays_template_linear.cc -------------------------------------------------------------------------------- /tree_dp/arrays_template_quadratic.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/tree_dp/arrays_template_quadratic.cc -------------------------------------------------------------------------------- /tree_dp/basic_template.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/tree_dp/basic_template.cc -------------------------------------------------------------------------------- /tree_dp/up_down_tree_dp.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/tree_dp/up_down_tree_dp.cc -------------------------------------------------------------------------------- /union_find/bipartite_union_find.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/union_find/bipartite_union_find.cc -------------------------------------------------------------------------------- /union_find/kruskal.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/union_find/kruskal.cc -------------------------------------------------------------------------------- /union_find/union_find_size.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nealwu/competitive-programming/HEAD/union_find/union_find_size.cc --------------------------------------------------------------------------------