Skip to content

Instantly share code, notes, and snippets.

@lordofwizard
Last active January 11, 2023 09:43
Show Gist options
  • Save lordofwizard/2cc90c54095ff4835fc93dc9b62eb316 to your computer and use it in GitHub Desktop.
Save lordofwizard/2cc90c54095ff4835fc93dc9b62eb316 to your computer and use it in GitHub Desktop.
#[allow(unused_imports)]
use std::io;
use std::str::FromStr;
fn main() {
let mut scanner = Scanner::default();
let t = scanner.next::<u64>();
for _ in 0..t{
solve();
}
}
fn solve(){
let mut s = Scanner::default();
}
#[derive(Default)]
struct Scanner {
input: Vec<String>,
}
#[allow(dead_code)]
impl Scanner {
fn next<T: FromStr>(&mut self) -> T {
loop {
if let Some(value) = self.input.pop() {
return value.parse().ok().expect("Failed at parsing!");
}
let mut input = String::new();
io::stdin()
.read_line(&mut input)
.expect("Failed at taking inputs");
self.input = input
.trim()
.split_whitespace()
.rev()
.map(String::from)
.collect();
}
}
fn int(&mut self) -> i64 {
loop {
if let Some(value) = self.input.pop() {
return value.parse().ok().expect("Failed at parsing!");
}
let mut input = String::new();
io::stdin()
.read_line(&mut input)
.expect("Failed at taking inputs");
self.input = input
.trim()
.split_whitespace()
.rev()
.map(String::from)
.collect();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment