Files
2019/inputs
Parnic 4cde56eb84 Day 14 solution
This one's part 1 destroyed me. I had a very difficult time, trying 3 separate approaches, each one of which worked for most cases but eventually fell apart on the 5th sample or my actual puzzle input. I ended up tweaking and rewriting until I landed on this which wasn't far off from what I was trying to do previously, but I had been overcomplicating things.

Part 2 surprised me in that I expected a simple "ore available divided by ore needed for 1 fuel" would solve it, but of course the excess chemicals produced in any given reaction meant that it wasn't that simple. So this approach uses that estimate as a lower bound, since it always underestimates, and then bisects its way to the solution (starting at the lower bound and adding 1 each time took too long). I'm sure a smarter upper bound choice could lower the runtime of this by a bit, but runtime isn't bad enough right now for me to try any additional optimizations.
2022-06-28 08:32:59 -05:00
..
2022-06-06 15:14:31 -05:00
2022-06-07 09:26:21 -05:00
2022-06-08 08:23:07 -05:00
2022-06-08 08:23:07 -05:00
2022-06-08 08:23:07 -05:00
2022-06-08 08:23:07 -05:00
2022-06-09 08:23:34 -05:00
2022-06-13 15:29:18 -05:00
2022-06-14 09:21:10 -05:00
2022-06-14 09:21:10 -05:00
2022-06-14 09:21:10 -05:00
2022-06-15 08:58:51 -05:00
2022-06-15 08:58:51 -05:00
2022-06-15 08:58:51 -05:00
2022-06-15 08:58:51 -05:00
2022-06-15 08:58:51 -05:00
2022-06-15 08:58:51 -05:00
2022-06-16 08:24:56 -05:00
2022-06-16 08:24:56 -05:00
2022-06-20 08:54:52 -05:00
2022-06-20 08:54:52 -05:00
2022-06-20 08:54:52 -05:00
2022-06-20 08:54:52 -05:00
2022-06-21 12:18:31 -05:00
2022-06-21 12:18:31 -05:00
2022-06-21 12:18:31 -05:00
2022-06-21 12:18:31 -05:00
2022-06-21 12:18:31 -05:00
2022-06-21 12:18:31 -05:00
2022-06-21 12:18:31 -05:00
2022-06-22 08:17:45 -05:00
2022-06-23 10:08:33 -05:00
2022-06-23 10:08:33 -05:00
2022-06-23 10:08:33 -05:00
2022-06-27 00:01:19 -05:00
2022-06-28 08:32:59 -05:00
2022-06-28 08:32:59 -05:00
2022-06-28 08:32:59 -05:00
2022-06-28 08:32:59 -05:00
2022-06-28 08:32:59 -05:00
2022-06-28 08:32:59 -05:00
2022-06-06 15:14:31 -05:00