aboutsummaryrefslogtreecommitdiff
path: root/2022/19/a.rs
blob: 726457904bc8a66e49e8ec6c8c5a709aa13c55f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::collections::HashMap;
mod common;
use common::*;

fn main() {
    const MINUTES: i32 = 24;
    let mut mem = HashMap::<(Status, i32), i32>::new();
    let mut i = 1;
    let mut sum = 0;
    for bp in read_blueprints_from_stdin() {
        let mg = most_geodes(&bp, Status::new(), MINUTES, &mut mem, 0);
        println!("{i}: {mg}");
        sum += i * mg;
        mem.clear();
        i += 1;
    }
    println!("{sum}");
}

Generated with cgit - Back to sebastiano.tronto.net