Skip to content

Instantly share code, notes, and snippets.

@icub3d
Created December 14, 2025 02:26
Show Gist options
  • Select an option

  • Save icub3d/8f54394a073b30f9d8c4a809a64dd3d4 to your computer and use it in GitHub Desktop.

Select an option

Save icub3d/8f54394a073b30f9d8c4a809a64dd3d4 to your computer and use it in GitHub Desktop.
Kattis licensetolaunch
use std::io::{Read, stdin};
fn main() {
let mut s = String::new();
stdin().read_to_string(&mut s).unwrap();
let mut m = s.lines();
m.next().unwrap();
let days = m
.next()
.unwrap()
.split_whitespace()
.map(|v| v.parse::<usize>().unwrap())
.collect::<Vec<_>>();
let i = days
.iter()
.rev() // TECHNICALLY CORRECT ?
.enumerate()
.min_by_key(|(_, v)| *v)
.map(|(i, _)| i)
.unwrap();
println!("{i}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment