diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-04 22:50:41 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-04 22:50:41 +0200 |
| commit | 6a717cd07577844a7d4183caa99b75149081d010 (patch) | |
| tree | c2aa246215e4d60fa49c5cba39234f9fc63a5132 /2022/19/a.rs | |
| parent | 433efb35ed49be9f2a05e7b8bf2d1cc3987b6bb3 (diff) | |
| download | aoc-6a717cd07577844a7d4183caa99b75149081d010.tar.gz aoc-6a717cd07577844a7d4183caa99b75149081d010.zip | |
Day 19 part 1 2022
Diffstat (limited to '2022/19/a.rs')
| -rw-r--r-- | 2022/19/a.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/2022/19/a.rs b/2022/19/a.rs new file mode 100644 index 0000000..57e83e6 --- /dev/null +++ b/2022/19/a.rs | |||
| @@ -0,0 +1,18 @@ | |||
| 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), i32>::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 | } | ||
