diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-06 09:48:32 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-06 09:48:32 +0200 |
| commit | 58800a74af2c9f3578d3e62b3226aaf7c73aef87 (patch) | |
| tree | a34e75378d99a16196fc95fb23e2d5d80f22e1bb /2022/19/b.rs | |
| parent | 950d82569ddf137f1674095bfbe6bfff8fce663f (diff) | |
| download | aoc-58800a74af2c9f3578d3e62b3226aaf7c73aef87.tar.gz aoc-58800a74af2c9f3578d3e62b3226aaf7c73aef87.zip | |
Finally, part 2 for Day 19 2022
Diffstat (limited to '2022/19/b.rs')
| -rw-r--r-- | 2022/19/b.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/2022/19/b.rs b/2022/19/b.rs new file mode 100644 index 0000000..d97bf53 --- /dev/null +++ b/2022/19/b.rs | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | use std::collections::HashMap; | ||
| 2 | mod common; | ||
| 3 | use common::*; | ||
| 4 | |||
| 5 | fn main() { | ||
| 6 | const MINUTES: i32 = 32; | ||
| 7 | let mut mem = HashMap::<(Status, i32), i64>::new(); | ||
| 8 | let mut prod = 1; | ||
| 9 | let bp = read_blueprints_from_stdin(); | ||
| 10 | for i in 0..3 { | ||
| 11 | let mg = most_geodes(&bp[i], &Status::new(), MINUTES, &mut mem); | ||
| 12 | println!("{i}: {mg}"); | ||
| 13 | prod *= mg; | ||
| 14 | mem.clear(); | ||
| 15 | } | ||
| 16 | println!("{prod}"); | ||
| 17 | } | ||
