diff options
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 | } | ||
