Algorithms and data structures for competitive programming in Rust.
- Rust 1.89.0
- Rust edition 2024
- Compatible with the current AtCoder and Codeforces Rust environments
- No external crate dependencies
├── algorithm
│ ├── atkin.rs
│ ├── convex_hull_trick.rs
│ ├── cumsum.rs
│ ├── enum_divisors.rs
│ ├── eratosthenes.rs
│ ├── fast_eratosthenes.rs
│ ├── inversion_number.rs
│ ├── largest_rectangle.rs
│ ├── prime.rs
│ └── run_length.rs
├── graph
│ ├── dijkstra.rs
│ ├── dijkstra_restore_path.rs
│ ├── euler_tour.rs
│ ├── floyd_warshall.rs
│ ├── heavy_light_decomposition.rs
│ ├── lowest_common_ancestor_doubling.rs
│ ├── lowest_common_ancestor_rmq.rs
│ ├── minimum_spanning_tree_kruskal.rs
│ ├── minimum_spanning_tree_prim.rs
│ ├── shortest_path_faster_algorithm.rs
│ ├── strongly_connected_component.rs
│ ├── tree_diameter.rs
│ ├── util.rs
│ └── zero_one_bfs.rs
├── lib.rs
├── math
│ ├── euclid.rs
│ ├── miller_rabin.rs
│ ├── mod_pow.rs
│ └── permutation.rs
├── other
│ ├── binary_search.rs
│ ├── ternary_search.rs
│ ├── xorshift.rs
│ └── zobrist_hash.rs
├── string
│ ├── aho_corasick.rs
│ ├── manacher.rs
│ ├── rolling_hash.rs
│ └── z_algorithm.rs
└── structure
├── binary_trie.rs
├── cumsum_2d.rs
├── disjoint_set_union.rs
├── disjoint_set_union_undo.rs
├── disjoint_sparse_table.rs
├── fenwick_tree.rs
├── quaternary_trie.rs
├── segment_tree.rs
├── skew_heap.rs
├── skew_heap_lazy.rs
├── sparse_table.rs
├── treap.rs
└── weighted_disjoint_set_union.rs
Generated API documentation is available at github.uesugi.app/competitive-library.
The repository pins the judge-compatible toolchain in rust-toolchain.toml.
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --all-targets --release --offlineCI checks two judge profiles separately:
- AtCoder: Cargo release build in offline mode
- Codeforces: direct
rustc --edition=2024 -Ocompilation
Previously published misspelled module paths remain available as deprecated aliases.
New code should use the corrected paths, such as tree_diameter, manacher,
rolling_hash, and minimum_spanning_tree_*.