description.txt 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. --- Day 19: Not Enough Minerals ---
  2. Your scans show that the lava did indeed form obsidian!
  3. The wind has changed direction enough to stop sending lava droplets toward you, so you and the elephants exit the cave. As you do, you notice a collection of geodes around the pond. Perhaps you could use the obsidian to create some geode-cracking robots and break them open?
  4. To collect the obsidian from the bottom of the pond, you'll need waterproof obsidian-collecting robots. Fortunately, there is an abundant amount of clay nearby that you can use to make them waterproof.
  5. In order to harvest the clay, you'll need special-purpose clay-collecting robots. To make any type of robot, you'll need ore, which is also plentiful but in the opposite direction from the clay.
  6. Collecting ore requires ore-collecting robots with big drills. Fortunately, you have exactly one ore-collecting robot in your pack that you can use to kickstart the whole operation.
  7. Each robot can collect 1 of its resource type per minute. It also takes one minute for the robot factory (also conveniently from your pack) to construct any type of robot, although it consumes the necessary resources available when construction begins.
  8. The robot factory has many blueprints (your puzzle input) you can choose from, but once you've configured it with a blueprint, you can't change it. You'll need to work out which blueprint is best.
  9. For example:
  10. Blueprint 1:
  11. Each ore robot costs 4 ore.
  12. Each clay robot costs 2 ore.
  13. Each obsidian robot costs 3 ore and 14 clay.
  14. Each geode robot costs 2 ore and 7 obsidian.
  15. Blueprint 2:
  16. Each ore robot costs 2 ore.
  17. Each clay robot costs 3 ore.
  18. Each obsidian robot costs 3 ore and 8 clay.
  19. Each geode robot costs 3 ore and 12 obsidian.
  20. (Blueprints have been line-wrapped here for legibility. The robot factory's actual assortment of blueprints are provided one blueprint per line.)
  21. The elephants are starting to look hungry, so you shouldn't take too long; you need to figure out which blueprint would maximize the number of opened geodes after 24 minutes by figuring out which robots to build and when to build them.
  22. Using blueprint 1 in the example above, the largest number of geodes you could open in 24 minutes is 9. One way to achieve that is:
  23. == Minute 1 ==
  24. 1 ore-collecting robot collects 1 ore; you now have 1 ore.
  25. == Minute 2 ==
  26. 1 ore-collecting robot collects 1 ore; you now have 2 ore.
  27. == Minute 3 ==
  28. Spend 2 ore to start building a clay-collecting robot.
  29. 1 ore-collecting robot collects 1 ore; you now have 1 ore.
  30. The new clay-collecting robot is ready; you now have 1 of them.
  31. == Minute 4 ==
  32. 1 ore-collecting robot collects 1 ore; you now have 2 ore.
  33. 1 clay-collecting robot collects 1 clay; you now have 1 clay.
  34. == Minute 5 ==
  35. Spend 2 ore to start building a clay-collecting robot.
  36. 1 ore-collecting robot collects 1 ore; you now have 1 ore.
  37. 1 clay-collecting robot collects 1 clay; you now have 2 clay.
  38. The new clay-collecting robot is ready; you now have 2 of them.
  39. == Minute 6 ==
  40. 1 ore-collecting robot collects 1 ore; you now have 2 ore.
  41. 2 clay-collecting robots collect 2 clay; you now have 4 clay.
  42. == Minute 7 ==
  43. Spend 2 ore to start building a clay-collecting robot.
  44. 1 ore-collecting robot collects 1 ore; you now have 1 ore.
  45. 2 clay-collecting robots collect 2 clay; you now have 6 clay.
  46. The new clay-collecting robot is ready; you now have 3 of them.
  47. == Minute 8 ==
  48. 1 ore-collecting robot collects 1 ore; you now have 2 ore.
  49. 3 clay-collecting robots collect 3 clay; you now have 9 clay.
  50. == Minute 9 ==
  51. 1 ore-collecting robot collects 1 ore; you now have 3 ore.
  52. 3 clay-collecting robots collect 3 clay; you now have 12 clay.
  53. == Minute 10 ==
  54. 1 ore-collecting robot collects 1 ore; you now have 4 ore.
  55. 3 clay-collecting robots collect 3 clay; you now have 15 clay.
  56. == Minute 11 ==
  57. Spend 3 ore and 14 clay to start building an obsidian-collecting robot.
  58. 1 ore-collecting robot collects 1 ore; you now have 2 ore.
  59. 3 clay-collecting robots collect 3 clay; you now have 4 clay.
  60. The new obsidian-collecting robot is ready; you now have 1 of them.
  61. == Minute 12 ==
  62. Spend 2 ore to start building a clay-collecting robot.
  63. 1 ore-collecting robot collects 1 ore; you now have 1 ore.
  64. 3 clay-collecting robots collect 3 clay; you now have 7 clay.
  65. 1 obsidian-collecting robot collects 1 obsidian; you now have 1 obsidian.
  66. The new clay-collecting robot is ready; you now have 4 of them.
  67. == Minute 13 ==
  68. 1 ore-collecting robot collects 1 ore; you now have 2 ore.
  69. 4 clay-collecting robots collect 4 clay; you now have 11 clay.
  70. 1 obsidian-collecting robot collects 1 obsidian; you now have 2 obsidian.
  71. == Minute 14 ==
  72. 1 ore-collecting robot collects 1 ore; you now have 3 ore.
  73. 4 clay-collecting robots collect 4 clay; you now have 15 clay.
  74. 1 obsidian-collecting robot collects 1 obsidian; you now have 3 obsidian.
  75. == Minute 15 ==
  76. Spend 3 ore and 14 clay to start building an obsidian-collecting robot.
  77. 1 ore-collecting robot collects 1 ore; you now have 1 ore.
  78. 4 clay-collecting robots collect 4 clay; you now have 5 clay.
  79. 1 obsidian-collecting robot collects 1 obsidian; you now have 4 obsidian.
  80. The new obsidian-collecting robot is ready; you now have 2 of them.
  81. == Minute 16 ==
  82. 1 ore-collecting robot collects 1 ore; you now have 2 ore.
  83. 4 clay-collecting robots collect 4 clay; you now have 9 clay.
  84. 2 obsidian-collecting robots collect 2 obsidian; you now have 6 obsidian.
  85. == Minute 17 ==
  86. 1 ore-collecting robot collects 1 ore; you now have 3 ore.
  87. 4 clay-collecting robots collect 4 clay; you now have 13 clay.
  88. 2 obsidian-collecting robots collect 2 obsidian; you now have 8 obsidian.
  89. == Minute 18 ==
  90. Spend 2 ore and 7 obsidian to start building a geode-cracking robot.
  91. 1 ore-collecting robot collects 1 ore; you now have 2 ore.
  92. 4 clay-collecting robots collect 4 clay; you now have 17 clay.
  93. 2 obsidian-collecting robots collect 2 obsidian; you now have 3 obsidian.
  94. The new geode-cracking robot is ready; you now have 1 of them.
  95. == Minute 19 ==
  96. 1 ore-collecting robot collects 1 ore; you now have 3 ore.
  97. 4 clay-collecting robots collect 4 clay; you now have 21 clay.
  98. 2 obsidian-collecting robots collect 2 obsidian; you now have 5 obsidian.
  99. 1 geode-cracking robot cracks 1 geode; you now have 1 open geode.
  100. == Minute 20 ==
  101. 1 ore-collecting robot collects 1 ore; you now have 4 ore.
  102. 4 clay-collecting robots collect 4 clay; you now have 25 clay.
  103. 2 obsidian-collecting robots collect 2 obsidian; you now have 7 obsidian.
  104. 1 geode-cracking robot cracks 1 geode; you now have 2 open geodes.
  105. == Minute 21 ==
  106. Spend 2 ore and 7 obsidian to start building a geode-cracking robot.
  107. 1 ore-collecting robot collects 1 ore; you now have 3 ore.
  108. 4 clay-collecting robots collect 4 clay; you now have 29 clay.
  109. 2 obsidian-collecting robots collect 2 obsidian; you now have 2 obsidian.
  110. 1 geode-cracking robot cracks 1 geode; you now have 3 open geodes.
  111. The new geode-cracking robot is ready; you now have 2 of them.
  112. == Minute 22 ==
  113. 1 ore-collecting robot collects 1 ore; you now have 4 ore.
  114. 4 clay-collecting robots collect 4 clay; you now have 33 clay.
  115. 2 obsidian-collecting robots collect 2 obsidian; you now have 4 obsidian.
  116. 2 geode-cracking robots crack 2 geodes; you now have 5 open geodes.
  117. == Minute 23 ==
  118. 1 ore-collecting robot collects 1 ore; you now have 5 ore.
  119. 4 clay-collecting robots collect 4 clay; you now have 37 clay.
  120. 2 obsidian-collecting robots collect 2 obsidian; you now have 6 obsidian.
  121. 2 geode-cracking robots crack 2 geodes; you now have 7 open geodes.
  122. == Minute 24 ==
  123. 1 ore-collecting robot collects 1 ore; you now have 6 ore.
  124. 4 clay-collecting robots collect 4 clay; you now have 41 clay.
  125. 2 obsidian-collecting robots collect 2 obsidian; you now have 8 obsidian.
  126. 2 geode-cracking robots crack 2 geodes; you now have 9 open geodes.
  127. However, by using blueprint 2 in the example above, you could do even better: the largest number of geodes you could open in 24 minutes is 12.
  128. Determine the quality level of each blueprint by multiplying that blueprint's ID number with the largest number of geodes that can be opened in 24 minutes using that blueprint. In this example, the first blueprint has ID 1 and can open 9 geodes, so its quality level is 9. The second blueprint has ID 2 and can open 12 geodes, so its quality level is 24. Finally, if you add up the quality levels of all of the blueprints in the list, you get 33.
  129. Determine the quality level of each blueprint using the largest number of geodes it could produce in 24 minutes. What do you get if you add up the quality level of all of the blueprints in your list?