2022 Day 16 Complete
This commit is contained in:
@@ -1,46 +1,24 @@
|
||||
Advent of Code
|
||||
|
||||
• [About]
|
||||
• [Events]
|
||||
• [Shop]
|
||||
• [Settings]
|
||||
• [Log Out]
|
||||
|
||||
br0xen (AoC++) 29*
|
||||
|
||||
/^2022$/
|
||||
|
||||
• [Calendar]
|
||||
• [AoC++]
|
||||
• [Sponsors]
|
||||
• [Leaderboard]
|
||||
• [Stats]
|
||||
|
||||
Our sponsors help make Advent of Code possible:
|
||||
Sentry.io - More than 3.5 million developers across 85,000 organizations ship better software, faster, with Sentry. What
|
||||
are you waiting for?
|
||||
Advent of Code
|
||||
br0xen (AoC++) 47*
|
||||
|
||||
--- Day 16: Proboscidea Volcanium ---
|
||||
|
||||
The sensors have led you to the origin of the distress signal: yet another handheld device, just like the one the Elves
|
||||
gave you. However, you don't see any Elves around; instead, the device is surrounded by elephants! They must have gotten
|
||||
lost in these tunnels, and one of the elephants apparently figured out how to turn on the distress signal.
|
||||
The sensors have led you to the origin of the distress signal: yet another handheld device, just like the one the Elves gave you. However, you don't see
|
||||
any Elves around; instead, the device is surrounded by elephants! They must have gotten lost in these tunnels, and one of the elephants apparently
|
||||
figured out how to turn on the distress signal.
|
||||
|
||||
The ground rumbles again, much stronger this time. What kind of cave is this, exactly? You scan the cave with your
|
||||
handheld device; it reports mostly igneous rock, some ash, pockets of pressurized gas, magma... this isn't just a cave,
|
||||
it's a volcano!
|
||||
The ground rumbles again, much stronger this time. What kind of cave is this, exactly? You scan the cave with your handheld device; it reports mostly
|
||||
igneous rock, some ash, pockets of pressurized gas, magma... this isn't just a cave, it's a volcano!
|
||||
|
||||
You need to get the elephants out of here, quickly. Your device estimates that you have 30 minutes before the volcano
|
||||
erupts, so you don't have time to go back out the way you came in.
|
||||
You need to get the elephants out of here, quickly. Your device estimates that you have 30 minutes before the volcano erupts, so you don't have time to
|
||||
go back out the way you came in.
|
||||
|
||||
You scan the cave for other options and discover a network of pipes and pressure-release valves. You aren't sure how
|
||||
such a system got into a volcano, but you don't have time to complain; your device produces a report (your puzzle input)
|
||||
of each valve's flow rate if it were opened (in pressure per minute) and the tunnels you could use to move between the
|
||||
valves.
|
||||
You scan the cave for other options and discover a network of pipes and pressure-release valves. You aren't sure how such a system got into a volcano,
|
||||
but you don't have time to complain; your device produces a report (your puzzle input) of each valve's flow rate if it were opened (in pressure per
|
||||
minute) and the tunnels you could use to move between the valves.
|
||||
|
||||
There's even a valve in the room you and the elephants are currently standing in labeled AA. You estimate it will take
|
||||
you one minute to open a single valve and one minute to follow any tunnel from one valve to another. What is the most
|
||||
pressure you could release?
|
||||
There's even a valve in the room you and the elephants are currently standing in labeled AA. You estimate it will take you one minute to open a single
|
||||
valve and one minute to follow any tunnel from one valve to another. What is the most pressure you could release?
|
||||
|
||||
For example, suppose you had the following scan output:
|
||||
|
||||
@@ -55,16 +33,14 @@
|
||||
Valve II has flow rate=0; tunnels lead to valves AA, JJ
|
||||
Valve JJ has flow rate=21; tunnel leads to valve II
|
||||
|
||||
All of the valves begin closed. You start at valve AA, but it must be damaged or jammed or something: its flow rate is
|
||||
0, so there's no point in opening it. However, you could spend one minute moving to valve BB and another minute opening
|
||||
it; doing so would release pressure during the remaining 28 minutes at a flow rate of 13, a total eventual pressure
|
||||
release of 28 * 13 = 364. Then, you could spend your third minute moving to valve CC and your fourth minute opening it,
|
||||
providing an additional 26 minutes of eventual pressure release at a flow rate of 2, or 52 total pressure released by
|
||||
valve CC.
|
||||
All of the valves begin closed. You start at valve AA, but it must be damaged or jammed or something: its flow rate is 0, so there's no point in opening
|
||||
it. However, you could spend one minute moving to valve BB and another minute opening it; doing so would release pressure during the remaining 28
|
||||
minutes at a flow rate of 13, a total eventual pressure release of 28 * 13 = 364. Then, you could spend your third minute moving to valve CC and your
|
||||
fourth minute opening it, providing an additional 26 minutes of eventual pressure release at a flow rate of 2, or 52 total pressure released by valve
|
||||
CC.
|
||||
|
||||
Making your way through the tunnels like this, you could probably open many or all of the valves by the time 30 minutes
|
||||
have elapsed. However, you need to release as much pressure as possible, so you'll need to be methodical. Instead,
|
||||
consider this approach:
|
||||
Making your way through the tunnels like this, you could probably open many or all of the valves by the time 30 minutes have elapsed. However, you need
|
||||
to release as much pressure as possible, so you'll need to be methodical. Instead, consider this approach:
|
||||
|
||||
== Minute 1 ==
|
||||
No valves are open.
|
||||
@@ -184,11 +160,93 @@
|
||||
|
||||
Work out the steps to release the most pressure in 30 minutes. What is the most pressure you can release?
|
||||
|
||||
To begin, get your puzzle input.
|
||||
Your puzzle answer was 1862.
|
||||
|
||||
Answer: _____________________ [ [Submit] ]
|
||||
--- Part Two ---
|
||||
|
||||
You can also [Shareon Twitter Mastodon] this puzzle.
|
||||
You're worried that even with an optimal approach, the pressure released won't be enough. What if you got one of the elephants to help you?
|
||||
|
||||
It would take you 4 minutes to teach an elephant how to open the right valves in the right order, leaving you with only 26 minutes to actually execute
|
||||
your plan. Would having two of you working together be better, even if it means having less time? (Assume that you teach the elephant before opening any
|
||||
valves yourself, giving you both the same full 26 minutes.)
|
||||
|
||||
In the example above, you could teach the elephant to help you as follows:
|
||||
|
||||
== Minute 1 ==
|
||||
No valves are open.
|
||||
You move to valve II.
|
||||
The elephant moves to valve DD.
|
||||
|
||||
== Minute 2 ==
|
||||
No valves are open.
|
||||
You move to valve JJ.
|
||||
The elephant opens valve DD.
|
||||
|
||||
== Minute 3 ==
|
||||
Valve DD is open, releasing 20 pressure.
|
||||
You open valve JJ.
|
||||
The elephant moves to valve EE.
|
||||
|
||||
== Minute 4 ==
|
||||
Valves DD and JJ are open, releasing 41 pressure.
|
||||
You move to valve II.
|
||||
The elephant moves to valve FF.
|
||||
|
||||
== Minute 5 ==
|
||||
Valves DD and JJ are open, releasing 41 pressure.
|
||||
You move to valve AA.
|
||||
The elephant moves to valve GG.
|
||||
|
||||
== Minute 6 ==
|
||||
Valves DD and JJ are open, releasing 41 pressure.
|
||||
You move to valve BB.
|
||||
The elephant moves to valve HH.
|
||||
|
||||
== Minute 7 ==
|
||||
Valves DD and JJ are open, releasing 41 pressure.
|
||||
You open valve BB.
|
||||
The elephant opens valve HH.
|
||||
|
||||
== Minute 8 ==
|
||||
Valves BB, DD, HH, and JJ are open, releasing 76 pressure.
|
||||
You move to valve CC.
|
||||
The elephant moves to valve GG.
|
||||
|
||||
== Minute 9 ==
|
||||
Valves BB, DD, HH, and JJ are open, releasing 76 pressure.
|
||||
You open valve CC.
|
||||
The elephant moves to valve FF.
|
||||
|
||||
== Minute 10 ==
|
||||
Valves BB, CC, DD, HH, and JJ are open, releasing 78 pressure.
|
||||
The elephant moves to valve EE.
|
||||
|
||||
== Minute 11 ==
|
||||
Valves BB, CC, DD, HH, and JJ are open, releasing 78 pressure.
|
||||
The elephant opens valve EE.
|
||||
|
||||
(At this point, all valves are open.)
|
||||
|
||||
== Minute 12 ==
|
||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing 81 pressure.
|
||||
|
||||
...
|
||||
|
||||
== Minute 20 ==
|
||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing 81 pressure.
|
||||
|
||||
...
|
||||
|
||||
== Minute 26 ==
|
||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing 81 pressure.
|
||||
|
||||
With the elephant helping, after 26 minutes, the best you could do would release a total of 1707 pressure.
|
||||
|
||||
With you and an elephant working together for 26 minutes, what is the most pressure you could release?
|
||||
|
||||
Your puzzle answer was 2422.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
|
||||
References
|
||||
|
||||
@@ -196,7 +254,6 @@ References
|
||||
. https://adventofcode.com/
|
||||
. https://adventofcode.com/2022/about
|
||||
. https://adventofcode.com/2022/events
|
||||
. https://teespring.com/stores/advent-of-code
|
||||
. https://adventofcode.com/2022/settings
|
||||
. https://adventofcode.com/2022/auth/logout
|
||||
. Advent of Code Supporter
|
||||
@@ -208,7 +265,5 @@ References
|
||||
. https://adventofcode.com/2022/leaderboard
|
||||
. https://adventofcode.com/2022/stats
|
||||
. https://adventofcode.com/2022/sponsors
|
||||
. https://sentry.io/
|
||||
. https://adventofcode.com/2022
|
||||
. https://adventofcode.com/2022/day/16/input
|
||||
. https://twitter.com/intent/tweet?text=%22Proboscidea+Volcanium%22+%2D+Day+16+%2D+Advent+of+Code+2022&url=https%3A%2F%2Fadventofcode%2Ecom%2F2022%2Fday%2F16&related=ericwastl&hashtags=AdventOfCode
|
||||
. javascript:void(0);
|
||||
|
Reference in New Issue
Block a user