Skip to content

Instantly share code, notes, and snippets.

@icub3d
Created January 20, 2026 16:17
Show Gist options
  • Select an option

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

Select an option

Save icub3d/60358ca3fad867e1266b661620b07b7f to your computer and use it in GitHub Desktop.
Kattis peasoup
use std::io::{Read, stdin};
fn main() {
let mut s = String::new();
stdin().read_to_string(&mut s).unwrap();
let mut ss = s.lines();
let n = ss.next().unwrap().parse::<usize>().unwrap();
for _ in 0..n {
let k = ss.next().unwrap().parse::<usize>().unwrap();
let r = ss.next().unwrap();
let menu = (0..k).map(|_| ss.next().unwrap()).collect::<Vec<_>>();
if menu.contains(&"pea soup") && menu.contains(&"pancakes") {
println!("{r}");
return;
}
}
println!("Anywhere is fine I guess");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment