ac-lib
A Rust library for competitive programming on AtCoder.
Features
- π’ Math: GCD/LCM, Prime numbers, ModInt
- πΊοΈ Graph: DFS, BFS, Dijkstra, Union-Find
- π Data Structures: Segment Tree, Fenwick Tree
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
Math
use ;
// GCD
let result = gcd;
println!; // 6
// Prime check
println!; // true
// Modular arithmetic
let a = new;
let b = new;
let c = a.add;
println!; // 1999999993
Graph
use ;
// DFS
let graph = vec!;
let mut visited = vec!;
let order = dfs;
// Union-Find
let mut uf = new;
uf.union;
uf.union;
assert!;
assert_eq!;
Data Structures
use ;
// Segment Tree
let arr = vec!;
let mut segtree = new;
println!; // 15
// Fenwick Tree
let mut ft = from_vec;
println!; // 15
Testing
Testing
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Issues and Pull Requests are welcome!