Created
December 14, 2025 02:26
-
-
Save icub3d/aef94d70064f3930835f4efca96dbd77 to your computer and use it in GitHub Desktop.
Kattis earlywinter
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 mut lines = s.lines(); | |
| let (_, d_m) = lines | |
| .next() | |
| .unwrap() | |
| .split_once(' ') | |
| .map(|(l, r)| (l, r.parse::<usize>().unwrap())) | |
| .unwrap(); | |
| match lines | |
| .next() | |
| .unwrap() | |
| .split_whitespace() | |
| .map(|v| v.parse::<usize>().unwrap()) | |
| .enumerate() | |
| .find(|(_, m)| *m <= d_m) | |
| { | |
| Some((i, _)) => println!("It hadn't snowed this early in {i} years!"), | |
| None => println!("It had never snowed this early!"), | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment