Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
AtCoder ABC #061 [Rust]
use std::io;
use std::str::FromStr;
fn main() {
let stdin = io::stdin();
let mut buf = String::new();
stdin.read_line(&mut buf).ok();
let mut it = buf.split_whitespace().map(|n| i64::from_str(n).unwrap());
let (a, b, c) = (it.next().unwrap(), it.next().unwrap(), it.next().unwrap());
if c >= a && c <= b {
println!("Yes");
} else {
println!("No");
}
}
use std::io;
use std::str::FromStr;
fn main() {
let stdin = io::stdin();
let mut buf = String::new();
stdin.read_line(&mut buf).ok();
let mut it = buf.split_whitespace().map(|n| usize::from_str(n).unwrap());
let (n, m) = (it.next().unwrap(), it.next().unwrap());
let mut v = vec![0; n + 1];
for _ in 0..m {
let mut buf = String::new();
stdin.read_line(&mut buf).ok();
let mut it = buf.split_whitespace().map(|n| usize::from_str(n).unwrap());
let (a, b) = (it.next().unwrap(), it.next().unwrap());
v[a] += 1;
v[b] += 1;
}
for i in 1..(n+1) {
println!("{}", v[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment