/cp-rs

A competitive programming library for rust

Primary LanguageRustMIT LicenseMIT

cp-rs

ci-workflow

This library is intended to be used for competitive programming. It will be extended further and further with solutions to math, graph, geometry, ... problems in competitive programming. It also contains useful helpers for cp e.g. an io helper.

Usage Example

To read an integer and a float from each line in a file input.txt you can write the following code:

use cp_rs::io::*;

fn main() {
    let mut io = Io::from_file("input.txt");
    for mut line in io.line_io() {
        let (a, b): (u32, f32) = line.tuple();
    }
}

Features

  • General I/O handler
  • Utility for radix changes (will be reworked and put in the math module)
  • Utility for memoization
  • Utility for cryptographic functions
  • Utility for arbitrary precition ints + floats
  • Utility for random numbers
  • Support for graphs and graph algorithms
  • Support for math related algorithms / useful functions
  • Support for geometry related problems