├── .gitignore ├── .vscode ├── c_cpp_properties.json ├── extensions.json ├── keybindings.json ├── launch.json ├── settings.json └── tasks.json ├── CMakeLists.txt ├── CMakePresets.json ├── README.md ├── docs ├── Cheat Sheet.pdf ├── Momentum Library.docx └── Momentum Library.pdf ├── src ├── CMakeLists.txt ├── data_structures │ ├── disjoint_sets_union │ │ └── disjoint_sets_union.cpp │ ├── fenwick_tree │ │ ├── fenwick_tree.cpp │ │ ├── fenwick_tree_multiset.cpp │ │ └── fenwick_tree_range.cpp │ ├── interval_map │ │ └── interval_map.h │ ├── monotonic_queue │ │ ├── README.md │ │ ├── monotonic_queue.cpp │ │ └── monotonic_queue_using_stacks.cpp │ ├── segment_tree │ │ ├── persistent_segment_tree.cpp │ │ ├── segment_tree_dynamic.cpp │ │ ├── segment_tree_multiset.cpp │ │ └── segment_tree_static.cpp │ ├── sparse_table │ │ ├── README.md │ │ └── sparse_table.cpp │ ├── sqrt_decomposition │ │ └── mo_algorithm.cpp │ └── treap │ │ └── treap.cpp ├── graphs │ ├── lowest_common_ancestor │ │ ├── LCA.cpp │ │ └── LCA_Euler.cpp │ ├── max_flow │ │ └── edmonds_karp.cpp │ ├── minimum_spanning_tree │ │ ├── kruskal.cpp │ │ └── prim.cpp │ ├── others │ │ ├── bipartite_graph.cpp │ │ ├── bridge_tree.cpp │ │ ├── graph_bridges.cpp │ │ └── tree_diameter.cpp │ ├── shortest_path │ │ ├── bellman_ford.cpp │ │ ├── bellman_ford_optimized.cpp │ │ ├── bfs.cpp │ │ ├── bfs_complement_graph.cpp │ │ ├── dijkstra.cpp │ │ └── floyd_warshal.cpp │ ├── strongly_connected_components │ │ └── kosaraju.cpp │ └── traversal │ │ ├── graph_traversal.cpp │ │ └── graph_traversal_static.cpp ├── math │ ├── math.cpp │ ├── matrix.cpp │ └── matrix_minified.cpp ├── others │ ├── kth_order_statistic.cpp │ ├── others.cpp │ └── stress.cpp ├── search │ ├── binary_search.cpp │ └── ternary_search.cpp └── strings │ ├── KMP │ └── KMP.cpp │ ├── suffix_array │ ├── suffix_array.cpp │ └── suffix_array_slow.cpp │ ├── trie │ ├── trie_dynamic.cpp │ └── trie_static.cpp │ └── z_algorithm │ └── z_algorithm.cpp ├── tests └── CMakeLists.txt └── workspace ├── data ├── input.txt └── output.txt └── src └── main.cpp /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/.gitignore -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/.vscode/c_cpp_properties.json -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/.vscode/extensions.json -------------------------------------------------------------------------------- /.vscode/keybindings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/.vscode/keybindings.json -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/.vscode/launch.json -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/.vscode/settings.json -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/.vscode/tasks.json -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/CMakeLists.txt -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/CMakePresets.json -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/README.md -------------------------------------------------------------------------------- /docs/Cheat Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/docs/Cheat Sheet.pdf -------------------------------------------------------------------------------- /docs/Momentum Library.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/docs/Momentum Library.docx -------------------------------------------------------------------------------- /docs/Momentum Library.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/docs/Momentum Library.pdf -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/CMakeLists.txt -------------------------------------------------------------------------------- /src/data_structures/disjoint_sets_union/disjoint_sets_union.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/disjoint_sets_union/disjoint_sets_union.cpp -------------------------------------------------------------------------------- /src/data_structures/fenwick_tree/fenwick_tree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/fenwick_tree/fenwick_tree.cpp -------------------------------------------------------------------------------- /src/data_structures/fenwick_tree/fenwick_tree_multiset.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/fenwick_tree/fenwick_tree_multiset.cpp -------------------------------------------------------------------------------- /src/data_structures/fenwick_tree/fenwick_tree_range.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/fenwick_tree/fenwick_tree_range.cpp -------------------------------------------------------------------------------- /src/data_structures/interval_map/interval_map.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/interval_map/interval_map.h -------------------------------------------------------------------------------- /src/data_structures/monotonic_queue/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/monotonic_queue/README.md -------------------------------------------------------------------------------- /src/data_structures/monotonic_queue/monotonic_queue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/monotonic_queue/monotonic_queue.cpp -------------------------------------------------------------------------------- /src/data_structures/monotonic_queue/monotonic_queue_using_stacks.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/monotonic_queue/monotonic_queue_using_stacks.cpp -------------------------------------------------------------------------------- /src/data_structures/segment_tree/persistent_segment_tree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/segment_tree/persistent_segment_tree.cpp -------------------------------------------------------------------------------- /src/data_structures/segment_tree/segment_tree_dynamic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/segment_tree/segment_tree_dynamic.cpp -------------------------------------------------------------------------------- /src/data_structures/segment_tree/segment_tree_multiset.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/segment_tree/segment_tree_multiset.cpp -------------------------------------------------------------------------------- /src/data_structures/segment_tree/segment_tree_static.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/segment_tree/segment_tree_static.cpp -------------------------------------------------------------------------------- /src/data_structures/sparse_table/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/sparse_table/README.md -------------------------------------------------------------------------------- /src/data_structures/sparse_table/sparse_table.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/sparse_table/sparse_table.cpp -------------------------------------------------------------------------------- /src/data_structures/sqrt_decomposition/mo_algorithm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/sqrt_decomposition/mo_algorithm.cpp -------------------------------------------------------------------------------- /src/data_structures/treap/treap.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/data_structures/treap/treap.cpp -------------------------------------------------------------------------------- /src/graphs/lowest_common_ancestor/LCA.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/lowest_common_ancestor/LCA.cpp -------------------------------------------------------------------------------- /src/graphs/lowest_common_ancestor/LCA_Euler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/lowest_common_ancestor/LCA_Euler.cpp -------------------------------------------------------------------------------- /src/graphs/max_flow/edmonds_karp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/max_flow/edmonds_karp.cpp -------------------------------------------------------------------------------- /src/graphs/minimum_spanning_tree/kruskal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/minimum_spanning_tree/kruskal.cpp -------------------------------------------------------------------------------- /src/graphs/minimum_spanning_tree/prim.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/minimum_spanning_tree/prim.cpp -------------------------------------------------------------------------------- /src/graphs/others/bipartite_graph.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/others/bipartite_graph.cpp -------------------------------------------------------------------------------- /src/graphs/others/bridge_tree.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/others/bridge_tree.cpp -------------------------------------------------------------------------------- /src/graphs/others/graph_bridges.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/others/graph_bridges.cpp -------------------------------------------------------------------------------- /src/graphs/others/tree_diameter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/others/tree_diameter.cpp -------------------------------------------------------------------------------- /src/graphs/shortest_path/bellman_ford.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/shortest_path/bellman_ford.cpp -------------------------------------------------------------------------------- /src/graphs/shortest_path/bellman_ford_optimized.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/shortest_path/bellman_ford_optimized.cpp -------------------------------------------------------------------------------- /src/graphs/shortest_path/bfs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/shortest_path/bfs.cpp -------------------------------------------------------------------------------- /src/graphs/shortest_path/bfs_complement_graph.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/shortest_path/bfs_complement_graph.cpp -------------------------------------------------------------------------------- /src/graphs/shortest_path/dijkstra.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/shortest_path/dijkstra.cpp -------------------------------------------------------------------------------- /src/graphs/shortest_path/floyd_warshal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/shortest_path/floyd_warshal.cpp -------------------------------------------------------------------------------- /src/graphs/strongly_connected_components/kosaraju.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/strongly_connected_components/kosaraju.cpp -------------------------------------------------------------------------------- /src/graphs/traversal/graph_traversal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/traversal/graph_traversal.cpp -------------------------------------------------------------------------------- /src/graphs/traversal/graph_traversal_static.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/graphs/traversal/graph_traversal_static.cpp -------------------------------------------------------------------------------- /src/math/math.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/math/math.cpp -------------------------------------------------------------------------------- /src/math/matrix.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/math/matrix.cpp -------------------------------------------------------------------------------- /src/math/matrix_minified.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/math/matrix_minified.cpp -------------------------------------------------------------------------------- /src/others/kth_order_statistic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/others/kth_order_statistic.cpp -------------------------------------------------------------------------------- /src/others/others.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/others/others.cpp -------------------------------------------------------------------------------- /src/others/stress.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/others/stress.cpp -------------------------------------------------------------------------------- /src/search/binary_search.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/search/binary_search.cpp -------------------------------------------------------------------------------- /src/search/ternary_search.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/search/ternary_search.cpp -------------------------------------------------------------------------------- /src/strings/KMP/KMP.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/strings/KMP/KMP.cpp -------------------------------------------------------------------------------- /src/strings/suffix_array/suffix_array.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/strings/suffix_array/suffix_array.cpp -------------------------------------------------------------------------------- /src/strings/suffix_array/suffix_array_slow.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/strings/suffix_array/suffix_array_slow.cpp -------------------------------------------------------------------------------- /src/strings/trie/trie_dynamic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/strings/trie/trie_dynamic.cpp -------------------------------------------------------------------------------- /src/strings/trie/trie_static.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/strings/trie/trie_static.cpp -------------------------------------------------------------------------------- /src/strings/z_algorithm/z_algorithm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/src/strings/z_algorithm/z_algorithm.cpp -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/tests/CMakeLists.txt -------------------------------------------------------------------------------- /workspace/data/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | Omar 3 | Bazaraa 4 | Momentum 5 | -------------------------------------------------------------------------------- /workspace/data/output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/workspace/data/output.txt -------------------------------------------------------------------------------- /workspace/src/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmarBazaraa/Competitive-Programming/HEAD/workspace/src/main.cpp --------------------------------------------------------------------------------