Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save icub3d/2b302a359bdd38f00987e0a94a5898bc to your computer and use it in GitHub Desktop.
Kattis helpaphd
use std::io::{Read, stdin};
fn main() {
let mut s = String::new();
stdin().read_to_string(&mut s).unwrap();
for m in s.lines().skip(1) {
if m == "P=NP" {
println!("skipped");
continue;
}
let (l, r) = m
.split_once('+')
.map(|(l, r)| (l.parse::<usize>().unwrap(), r.parse::<usize>().unwrap()))
.unwrap();
println!("{}", l + r);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment