aboutsummaryrefslogtreecommitdiff
path: root/2022/19/a.rs
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-07-04 22:50:41 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-07-04 22:50:41 +0200
commit6a717cd07577844a7d4183caa99b75149081d010 (patch)
treec2aa246215e4d60fa49c5cba39234f9fc63a5132 /2022/19/a.rs
parent433efb35ed49be9f2a05e7b8bf2d1cc3987b6bb3 (diff)
downloadaoc-6a717cd07577844a7d4183caa99b75149081d010.tar.gz
aoc-6a717cd07577844a7d4183caa99b75149081d010.zip
Day 19 part 1 2022
Diffstat (limited to '2022/19/a.rs')
-rw-r--r--2022/19/a.rs18
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 @@
1use std::collections::HashMap;
2mod common;
3use common::*;
4
5fn 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}

Generated with cgit - Back to sebastiano.tronto.net