r/adventofcode • u/musifter • Apr 25 '26
Other [2018 Day 25] In Review (Four-Dimensional Adventure)
And it turns out that the reindeer medicine we need is the hot chocolate we were working on 1000 years in the future. We just need to open a portal to get it, using constellations of 4D fixed points.
And so we get a problem that's very much like Day 12 of 2017, where we were the number of disconnected subgraphs. Only this time, the input isn't a list of edges. But it's easy to make the graph from the points, so that's what I did. Then I just found the subgraphs on it (with recursion). I suppose I could have done a number of fancier things, like building and counting the constellations in one pass. But reduction to a simpler problem is a standard problem solving technique. It serves me well with twisty puzzles.
And so we come the end of another year. Personally I really liked this year and don't think of it as particularly hard... but I know some people do. But that's probably because a lot of problems were more up my alley, with lots of simulations. Simulations can have a lot of chaos making them hard to debug if you don't get things exactly right. Which I can certainly understand causing a lot of people to spend a lot of time on this year.
Since this was the first year I did live, I took a look at my personal leaderboard times (something I've rarely done). I see a lot of the days (especially early on) I was starting midday. Later on, I seem to have gone to starting at drop, and I got a bunch under 1000. I don't do these things for speed at all (none of the times are great... I don't rush, I take my time)... so that's mostly due to a lack of people doing AoC at the time. Still, in later years, there was typically a problem where I managed to get in the top 1000, not by being fast, but by knowing what to do and just doing it. I think that's probably why the best part 2 ranking I had was day 23 (breaking into the top 300). The scale of the puzzle is a bit overwhelming at first... but I immediately thought "quadtrees in 3D" and worked from there. I might not know all the competitive tricks (I tried one competition in University and decided it was not my thing), but sometimes I have relevant experience for a problem.
2
u/DelightfulCodeWeasel Apr 25 '26
Looking back at some of the puzzles I feel like 2018 was the year that Eric really started to hit his stride with AoC puzzle making, and I get the feeling he really had some fun with them this year.
A regex that's actually a maze? Brilliant stuff.
2
u/e_blake Apr 25 '26
This day has a nice speedup by switching from the naive O(n2) pairwise distance comparison of every point to instead an O(n) nearest neighbors check when you realize that the number of possible points fits in a 234 region and there are only 128 possible neigbors per point.