summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--20/README39
-rw-r--r--20/py/aoc20.py19
2 files changed, 52 insertions, 6 deletions
diff --git a/20/README b/20/README
new file mode 100644
index 0000000..88a2d91
--- /dev/null
+++ b/20/README
@@ -0,0 +1,39 @@
+Runtime:
+
+day part | time | tot_time | ans
+---------+--------+----------+-----------
+ 1 1 | 0.352 | 0.352 | 996996
+ 1 2 | 3.168 | 3.520 | 9210402
+ 2 1 | 0.846 | 4.366 | 591
+ 2 2 | 0.764 | 5.129 | 335
+ 3 1 | 1.921 | 7.051 | 209
+ 3 2 | 2.197 | 9.248 | 1574890240
+ 4 1 | 0.730 | 9.978 | 222
+ 4 2 | 1.570 | 11.547 | 140
+ 5 1 | 1.698 | 13.245 | 959
+ 5 2 | 1.772 | 15.017 | 527
+ 6 1 | 1.380 | 16.397 | 6714
+ 6 2 | 3.646 | 20.043 | 3435
+ 7 1 | 6.272 | 26.315 | 139
+ 7 2 | 4.574 | 30.889 | 58175
+ 8 1 | 0.277 | 31.166 | 2025
+ 8 2 | 1.211 | 32.377 | 826
+ 9 1 | 2.740 | 35.116 | 26796446
+ 9 2 | 2.762 | 37.878 | 3353494
+---------+--------+----------+-----------
+ x.xxx
+
+
+Stats:
+
+ -------Part 1-------- -------Part 2--------
+Day Time Rank Score Time Rank Score
+ 9 00:25:55 6220 0 00:31:44 4392 0
+ 8 00:08:21 1632 0 00:17:34 1265 0
+ 7 00:55:51 5031 0 01:03:46 3520 0
+ 6 00:07:31 2448 0 00:12:55 1957 0
+ 5 00:10:40 1390 0 00:12:48 927 0
+ 4 00:08:08 901 0 00:17:28 274 0
+ 3 00:07:53 1609 0 00:09:46 870 0
+ 2 00:16:55 3816 0 00:22:31 3446 0
+ 1 00:08:05 1193 0 00:10:00 1106 0
diff --git a/20/py/aoc20.py b/20/py/aoc20.py
index 101ddb0..5a90a91 100644
--- a/20/py/aoc20.py
+++ b/20/py/aoc20.py
@@ -67,11 +67,11 @@ if __name__ == "__main__":
print(f"maybe try {argv[0]} --help ?")
i += 1
+ print("day part | time | tot_time | ans")
+ print("----------+--------+----------+-----------")
- print("day part | time | tot_time | ans")
- print("---------+--------+----------+-----------")
-
- time_to_here = 0
+ tot_time, tot_time_part = 0, [0, 0]
+ runs = 0
for day, mod in enumerate((d01, d02, d03, d04, d05,
d06, d07, d08, d09)):
if day+1 in skip or (only and day+1 not in only):
@@ -87,5 +87,12 @@ if __name__ == "__main__":
ans_time = time.time()
times.append(ans_time-start)
avg_time = sum(times) / len(times)
- time_to_here += avg_time
- print(f"{day+1:02} {part+1} | {avg_time*1000:6.3f} | {time_to_here*1000:6.3f} | {ans}")
+ tot_time += avg_time
+ tot_time_part[part] += avg_time
+ print(f" {day+1:2} {part+1} | {avg_time*1000:6.3f} | {tot_time*1000:6.3f} | {ans}")
+ runs += 1
+ print("----------+--------+----------+-----------")
+ if only_part in (0, 1):
+ print(f"average 1 | {tot_time_part[0]*1000/runs:6.3f} |")
+ if only_part in (0, 2):
+ print(f"average 2 | {tot_time_part[1]*1000/runs:6.3f} |")