aboutsummaryrefslogtreecommitdiff
path: root/2022/19/a.rs
blob: 57e83e6eeacd62734a8b68bc2622c5d0148d140c (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);
        println!("{i}: {mg}");
        sum += i * mg;
        mem.clear();
        i += 1;
    }
    println!("{sum}");
}

Generated with cgit - Back to sebastiano.tronto.net