Thanks to Go's profiling tools, I discovered that the memoization, while it was cutting down runtime significantly, was itself slow because it was using arrays. Swapping those arrays out for maps made a _massive_ difference (4s/14s part1/part2 to 1ms/2ms with no other changes). Lesson learned. Again.
The IntHeap rename was long overdue since I took the code originally from Go's sample docs for priority queues.
This solves both parts much faster than before, but still on the order of 3-20 seconds, so more improvements (or another rewrite?) are needed. But we're getting there...
...sort of. It works, but it takes a lot longer than I'd like on real input. I optimized it with some memoization, but it's still far too slow to be the intended solution. I finished my actual input in over 3 minutes on my macbook m1 (...with the right answer, at least).
This solution as-is isn't really going to fly for part 2, though, so I'm probably going to have to re-do it either way.