Created
January 29, 2026 20:09
-
-
Save icub3d/7fdb23e31d80312a7401ef642e19aa6e to your computer and use it in GitHub Desktop.
Kattis missingnumbers
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 nn = s.lines().skip(1).map(|n| n.parse::<usize>().unwrap()); | |
| let mut exp = 1; | |
| let mut missed = false; | |
| for n in nn { | |
| while exp < n { | |
| println!("{exp}"); | |
| exp += 1; | |
| missed = true; | |
| } | |
| exp = n + 1; | |
| } | |
| if !missed { | |
| println!("good job"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment