Created
July 31, 2017 12:30
-
-
Save whatalnk/ff0fdcc5d3eeff7710981b3125cd2ee8 to your computer and use it in GitHub Desktop.
AtCoder ABC #061 [Rust]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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