Created
January 29, 2026 20:09
-
-
Save icub3d/3bc9abdb1d778adf6a04e8c8bb7f7c9a to your computer and use it in GitHub Desktop.
Kattis exactlyelectrical
This file contains hidden or 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::{Read, stdin}; | |
| fn main() { | |
| let mut s = String::new(); | |
| stdin().read_to_string(&mut s).unwrap(); | |
| let mut ss = s.split_whitespace().map(|v| v.parse::<isize>().unwrap()); | |
| let (x0, y0, x1, y1, t) = ( | |
| ss.next().unwrap(), | |
| ss.next().unwrap(), | |
| ss.next().unwrap(), | |
| ss.next().unwrap(), | |
| ss.next().unwrap(), | |
| ); | |
| let dist = (x0 - x1).abs() + (y0 - y1).abs(); | |
| // u-turn divisible by 2 | |
| if t >= dist && (t - dist) % 2 == 0 { | |
| println!("Y"); | |
| } else { | |
| println!("N"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment