Unable to use bit_set
to solve problems in Codeforces. I know this has be removed long back but why is it removed from the standard collections? Using bit sets we can optimize algorithm.
Would it be a nice to have a dedicated module for Competitive Rust programmers in standard library.
I hope it includes scanning stdIn like below code (which I have taken from codeforces) & all important collections.
#[allow(unused_imports)]
use std::io::{BufWriter, stdin, stdout, Write};
#[derive(Default)]
struct Scanner {
buffer: Vec<String>
}
impl Scanner {
fn next<T: std::str::FromStr>(&mut self) -> T {
loop {
if let Some(token) = self.buffer.pop() {
return token.parse().ok().expect("Failed parse");
}
let mut input = String::new();
stdin().read_line(&mut input).expect("Failed read");
self.buffer = input.split_whitespace().rev().map(String::from).collect();
}
}
}