Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created July 31, 2017 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/ff0fdcc5d3eeff7710981b3125cd2ee8 to your computer and use it in GitHub Desktop.
Save whatalnk/ff0fdcc5d3eeff7710981b3125cd2ee8 to your computer and use it in GitHub Desktop.
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