Created
December 5, 2025 19:43
-
-
Save icub3d/c2a6fc4d1f0c4a3a104e047dcff525fe to your computer and use it in GitHub Desktop.
Kattis nastyhacks
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::{ | |
| cmp::Ordering, | |
| io::{Read, stdin}, | |
| }; | |
| fn main() { | |
| let mut s = String::new(); | |
| stdin().read_to_string(&mut s).unwrap(); | |
| for m in s.lines().skip(1) { | |
| let pp = m | |
| .split_whitespace() | |
| .map(|v| v.parse::<isize>().unwrap()) | |
| .collect::<Vec<_>>(); | |
| let (r, e, c) = (pp[0], pp[1], pp[2]); | |
| println!( | |
| "{}", | |
| match r.cmp(&(e - c)) { | |
| Ordering::Greater => "do not advertise", | |
| Ordering::Less => "advertise", | |
| _ => "does not matter", | |
| } | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment