Skip to content

Instantly share code, notes, and snippets.

@icub3d
Created December 5, 2025 19:43
Show Gist options
  • Select an option

  • Save icub3d/c2a6fc4d1f0c4a3a104e047dcff525fe to your computer and use it in GitHub Desktop.

Select an option

Save icub3d/c2a6fc4d1f0c4a3a104e047dcff525fe to your computer and use it in GitHub Desktop.
Kattis nastyhacks
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