aoc

My solutions for the Advent of Code
git clone https://git.tronto.net/aoc
Download | Log | Files | Refs | README

a.rs (433B)


      1 use std::collections::HashMap;
      2 mod common;
      3 use common::*;
      4 
      5 fn main() {
      6     const MINUTES: i32 = 24;
      7     let mut mem = HashMap::<(Status, i32), i64>::new();
      8     let mut i = 1;
      9     let mut sum = 0;
     10     for bp in read_blueprints_from_stdin() {
     11         let mg = most_geodes(&bp, &Status::new(), MINUTES, &mut mem);
     12         println!("{i}: {mg}");
     13         sum += i * mg;
     14         mem.clear();
     15         i += 1;
     16     }
     17     println!("{sum}");
     18 }