2 Commits beb584bc0e ... 6952fa1d40

Author SHA1 Message Date
  Piotr Czajkowski 6952fa1d40 Added description 1 year ago
  Piotr Czajkowski c0bffe1400 Added input 1 year ago
2 changed files with 202 additions and 0 deletions
  1. 146 0
      16/description.txt
  2. 56 0
      16/input

+ 146 - 0
16/description.txt

@@ -0,0 +1,146 @@
+--- 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 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 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?
+
+For example, suppose you had the following scan output:
+
+Valve AA has flow rate=0; tunnels lead to valves DD, II, BB
+Valve BB has flow rate=13; tunnels lead to valves CC, AA
+Valve CC has flow rate=2; tunnels lead to valves DD, BB
+Valve DD has flow rate=20; tunnels lead to valves CC, AA, EE
+Valve EE has flow rate=3; tunnels lead to valves FF, DD
+Valve FF has flow rate=0; tunnels lead to valves EE, GG
+Valve GG has flow rate=0; tunnels lead to valves FF, HH
+Valve HH has flow rate=22; tunnel leads to valve GG
+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.
+
+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.
+You move to valve DD.
+
+== Minute 2 ==
+No valves are open.
+You open valve DD.
+
+== Minute 3 ==
+Valve DD is open, releasing 20 pressure.
+You move to valve CC.
+
+== Minute 4 ==
+Valve DD is open, releasing 20 pressure.
+You move to valve BB.
+
+== Minute 5 ==
+Valve DD is open, releasing 20 pressure.
+You open valve BB.
+
+== Minute 6 ==
+Valves BB and DD are open, releasing 33 pressure.
+You move to valve AA.
+
+== Minute 7 ==
+Valves BB and DD are open, releasing 33 pressure.
+You move to valve II.
+
+== Minute 8 ==
+Valves BB and DD are open, releasing 33 pressure.
+You move to valve JJ.
+
+== Minute 9 ==
+Valves BB and DD are open, releasing 33 pressure.
+You open valve JJ.
+
+== Minute 10 ==
+Valves BB, DD, and JJ are open, releasing 54 pressure.
+You move to valve II.
+
+== Minute 11 ==
+Valves BB, DD, and JJ are open, releasing 54 pressure.
+You move to valve AA.
+
+== Minute 12 ==
+Valves BB, DD, and JJ are open, releasing 54 pressure.
+You move to valve DD.
+
+== Minute 13 ==
+Valves BB, DD, and JJ are open, releasing 54 pressure.
+You move to valve EE.
+
+== Minute 14 ==
+Valves BB, DD, and JJ are open, releasing 54 pressure.
+You move to valve FF.
+
+== Minute 15 ==
+Valves BB, DD, and JJ are open, releasing 54 pressure.
+You move to valve GG.
+
+== Minute 16 ==
+Valves BB, DD, and JJ are open, releasing 54 pressure.
+You move to valve HH.
+
+== Minute 17 ==
+Valves BB, DD, and JJ are open, releasing 54 pressure.
+You open valve HH.
+
+== Minute 18 ==
+Valves BB, DD, HH, and JJ are open, releasing 76 pressure.
+You move to valve GG.
+
+== Minute 19 ==
+Valves BB, DD, HH, and JJ are open, releasing 76 pressure.
+You move to valve FF.
+
+== Minute 20 ==
+Valves BB, DD, HH, and JJ are open, releasing 76 pressure.
+You move to valve EE.
+
+== Minute 21 ==
+Valves BB, DD, HH, and JJ are open, releasing 76 pressure.
+You open valve EE.
+
+== Minute 22 ==
+Valves BB, DD, EE, HH, and JJ are open, releasing 79 pressure.
+You move to valve DD.
+
+== Minute 23 ==
+Valves BB, DD, EE, HH, and JJ are open, releasing 79 pressure.
+You move to valve CC.
+
+== Minute 24 ==
+Valves BB, DD, EE, HH, and JJ are open, releasing 79 pressure.
+You open valve CC.
+
+== Minute 25 ==
+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.
+
+== Minute 27 ==
+Valves BB, CC, DD, EE, HH, and JJ are open, releasing 81 pressure.
+
+== Minute 28 ==
+Valves BB, CC, DD, EE, HH, and JJ are open, releasing 81 pressure.
+
+== Minute 29 ==
+Valves BB, CC, DD, EE, HH, and JJ are open, releasing 81 pressure.
+
+== Minute 30 ==
+Valves BB, CC, DD, EE, HH, and JJ are open, releasing 81 pressure.
+
+This approach lets you release the most pressure possible in 30 minutes with this valve layout, 1651.
+
+Work out the steps to release the most pressure in 30 minutes. What is the most pressure you can release?

+ 56 - 0
16/input

@@ -0,0 +1,56 @@
+Valve XC has flow rate=0; tunnels lead to valves YK, AM
+Valve ME has flow rate=0; tunnels lead to valves UU, SX
+Valve EP has flow rate=0; tunnels lead to valves YS, QU
+Valve GR has flow rate=0; tunnels lead to valves QZ, OG
+Valve FA has flow rate=0; tunnels lead to valves DB, DP
+Valve UJ has flow rate=0; tunnels lead to valves XN, CH
+Valve QU has flow rate=0; tunnels lead to valves EP, YK
+Valve OX has flow rate=19; tunnels lead to valves RI, PV
+Valve VI has flow rate=0; tunnels lead to valves WI, XN
+Valve IQ has flow rate=0; tunnels lead to valves QL, OG
+Valve XO has flow rate=0; tunnels lead to valves GU, UI
+Valve IY has flow rate=0; tunnels lead to valves VC, NT
+Valve YS has flow rate=24; tunnel leads to valve EP
+Valve XN has flow rate=7; tunnels lead to valves DG, UJ, VD, VI, OU
+Valve AM has flow rate=6; tunnels lead to valves KA, NC, XC, TP, SI
+Valve IH has flow rate=8; tunnels lead to valves TW, CH, WY, EC
+Valve ZR has flow rate=18; tunnel leads to valve RI
+Valve FP has flow rate=14; tunnels lead to valves DP, UF
+Valve KA has flow rate=0; tunnels lead to valves VC, AM
+Valve NC has flow rate=0; tunnels lead to valves UI, AM
+Valve EC has flow rate=0; tunnels lead to valves IH, GU
+Valve DG has flow rate=0; tunnels lead to valves AA, XN
+Valve RI has flow rate=0; tunnels lead to valves OX, ZR
+Valve NJ has flow rate=0; tunnels lead to valves YK, TW
+Valve OG has flow rate=12; tunnels lead to valves GR, WY, IQ, UE
+Valve IB has flow rate=0; tunnels lead to valves VB, UU
+Valve RP has flow rate=0; tunnels lead to valves UI, OU
+Valve OU has flow rate=0; tunnels lead to valves XN, RP
+Valve NT has flow rate=0; tunnels lead to valves IY, AA
+Valve MN has flow rate=0; tunnels lead to valves LX, VC
+Valve SI has flow rate=0; tunnels lead to valves AM, AA
+Valve VB has flow rate=0; tunnels lead to valves KT, IB
+Valve UI has flow rate=4; tunnels lead to valves YI, XO, LX, NC, RP
+Valve DL has flow rate=0; tunnels lead to valves GU, UE
+Valve CH has flow rate=0; tunnels lead to valves UJ, IH
+Valve WI has flow rate=0; tunnels lead to valves VI, VC
+Valve GU has flow rate=11; tunnels lead to valves EC, XO, DL, SX
+Valve KT has flow rate=17; tunnels lead to valves PV, VB
+Valve TW has flow rate=0; tunnels lead to valves IH, NJ
+Valve UE has flow rate=0; tunnels lead to valves DL, OG
+Valve PV has flow rate=0; tunnels lead to valves KT, OX
+Valve DP has flow rate=0; tunnels lead to valves FP, FA
+Valve TP has flow rate=0; tunnels lead to valves VD, AM
+Valve YI has flow rate=0; tunnels lead to valves AA, UI
+Valve LX has flow rate=0; tunnels lead to valves UI, MN
+Valve QZ has flow rate=0; tunnels lead to valves GR, UU
+Valve DB has flow rate=23; tunnel leads to valve FA
+Valve SX has flow rate=0; tunnels lead to valves ME, GU
+Valve QL has flow rate=0; tunnels lead to valves AA, IQ
+Valve YK has flow rate=16; tunnels lead to valves NJ, XC, QU
+Valve VC has flow rate=5; tunnels lead to valves UF, KA, WI, IY, MN
+Valve VD has flow rate=0; tunnels lead to valves TP, XN
+Valve WY has flow rate=0; tunnels lead to valves IH, OG
+Valve AA has flow rate=0; tunnels lead to valves YI, DG, QL, NT, SI
+Valve UF has flow rate=0; tunnels lead to valves VC, FP
+Valve UU has flow rate=15; tunnels lead to valves QZ, IB, ME