day 11 final (C)

This commit is contained in:
2021-12-12 19:37:31 +01:00
parent dbf9b52cb3
commit 9c5e734ece
5 changed files with 112 additions and 60 deletions

View File

@@ -299,5 +299,50 @@ After 100 steps, there have been a total of 1656 flashes.
Given the starting energy levels of the dumbo octopuses in your cavern, simulate 100 steps. How many total flashes are there after 100 steps?
Your puzzle answer was 1739.
--- Part Two ---
The first half of this puzzle is complete! It provides one gold star: *
It seems like the individual flashes aren't bright enough to navigate. However, you might have a better option: the flashes seem to be synchronizing!
In the example above, the first time all octopuses flash simultaneously is step 195:
After step 193:
5877777777
8877777777
7777777777
7777777777
7777777777
7777777777
7777777777
7777777777
7777777777
7777777777
After step 194:
6988888888
9988888888
8888888888
8888888888
8888888888
8888888888
8888888888
8888888888
8888888888
8888888888
After step 195:
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
If you can calculate the exact moments when the octopuses will all flash simultaneously, you should be able to navigate through the cavern. What is the first step during which all octopuses flash?
Your puzzle answer was 324.
Both parts of this puzzle are complete! They provide two gold stars: **