Created
December 14, 2025 02:26
-
-
Save icub3d/7bf311611dcd0d85330b2f30f4460698 to your computer and use it in GitHub Desktop.
Kattis statistics
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(); | |
| for (i, m) in s.lines().enumerate() { | |
| let vv = m | |
| .split_whitespace() | |
| .skip(1) | |
| .map(|v| v.parse::<isize>().unwrap()) | |
| .collect::<Vec<_>>(); | |
| let min = vv.iter().min().unwrap(); | |
| let max = vv.iter().max().unwrap(); | |
| println!("Case {}: {} {} {}", i + 1, min, max, max - min); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment