Facilitates answering to competitive programming problems.
This crate is intended to be used with cargo-equip, which is a tool to bundle code into single .rs
file.
See the documentation on Docs.rs.
rust
use mic::{answer, solve};
```rust
fn main() -> _ { 1 } // 1 → println!("{}", 1) ```
```rust
fn main() -> _ { true } // true → "Yes" // → println!("{}", "Yes") ```
```rust
fn main() -> _ { (42, "foo") } // (42, "foo") → "42 foo".toowned() // → println!("{}", "42 foo".toowned()) ```
```rust
fn main() -> _ { 1..=3 } // 1..=3 → "1\n2\n3".toowned() // → println!("{}", "1\n2\n3".toowned()) ```
```rust
fn main() -> _ { vec![vec![1, 2], vec![3, 4]] } // vec![vec![1, 2], vec![3, 4]] → "1 2\n3 4".toowned() // → println!("{}", "1 2\n3 4".toowned()) ```
```rust
fn main() -> _ { vec![0, 2, 4] // 0-based graph node indices } // vec![0, 2, 4] → { impl Iterator } ([1, 3, 5]) // → "1 3 5".toowned() // → println!("{}", "1 3 5".toowned()) ```
```
fn solve() -> _ { 1..=3 } // 1..=3 → "1 2 3".to_owned()
assert_eq!("1 2 3", solve()); ```
Licensed under CC0-1.0.