a.rs (384B)
1 mod common; 2 use common::*; 3 4 fn main() { 5 let mut screen = Screen::new(); 6 let rocks = get_rocks(); 7 let mut line = String::new(); 8 let _ = std::io::stdin().read_line(&mut line); 9 let line = &line[0..line.len()-1]; // remove newline 10 11 let mut t = 0; 12 for i in 0..2022 { 13 screen.drop_rock(&rocks[i%5], &mut t, &line); 14 } 15 println!("{}", screen.top); 16 }