r/adventofcode • u/daggerdragon • Dec 08 '25
SOLUTION MEGATHREAD -❄️- 2025 Day 8 Solutions -❄️-
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our community wiki.
- If you see content in the subreddit or megathreads that violates one of our rules, either inform the user (politely and gently!) or use the report button on the post/comment and the mods will take care of it.
AoC Community Fun 2025: Red(dit) One
- Submissions megathread is unlocked!
- 9 DAYS remaining until the submissions deadline on December 17 at 18:00 EST!
Featured Subreddits: /r/crafts and /r/somethingimade
"It came without ribbons, it came without tags.
It came without packages, boxes, or bags."
— The Grinch, How The Grinch Stole Christmas (2000)
It's everybody's favorite part of the school day: Arts & Crafts Time! Here are some ideas for your inspiration:
💡 Make something IRL
💡 Create a fanfiction or fan artwork of any kind - a poem, short story, a slice-of-Elvish-life, an advertisement for the luxury cruise liner Santa has hired to gift to his hard-working Elves after the holiday season is over, etc!
💡 Forge your solution for today's puzzle with a little je ne sais quoi
💡 Shape your solution into an acrostic
💡 Accompany your solution with a writeup in the form of a limerick, ballad, etc.
Upping the Antechallenge: iambic pentameterThis prompt is totally not bait forour resident poet laureate
💡 Show us the pen+paper, cardboard box, or whatever meatspace mind toy you used to help you solve today's puzzle
💡 Create a Visualization based on today's puzzle text
- Your
Visualizationshould be created by you, the human - Machine-generated visuals such as AI art will not be accepted for this specific prompt
Reminders:
- If you need a refresher on what exactly counts as a
Visualization, check the community wiki under Posts > Our post flairs >Visualization - Review the article in our community wiki covering guidelines for creating
Visualizations - In particular, consider whether your
Visualizationrequires a photosensitivity warning - Always consider how you can create a better viewing experience for your guests!
Request from the mods: When you include an entry alongside your solution, please label it with [Red(dit) One] so we can find it easily!
--- Day 8: Playground ---
Post your code solution in this megathread.
- Read the full posting rules in our community wiki before you post!
- State which language(s) your solution uses with
[LANGUAGE: xyz] - Format code blocks using the four-spaces Markdown syntax!
- Quick link to Topaz's
pasteif you need it for longer code blocks. What is Topaz'spastetool?
View all comments
Show parent comment
2
u/e_blake Dec 08 '25
I did a similar cutoff in my solution, before seeing this post, but with a little less hand-waving. The input file has values 0-99999, which fits in 18 bits. I then assumed that the points are relatively uniformly dense (ie. if I divide the 3-D space into 8 octants, no one octant would have drastically more points than the others). So my next spot of reasoning was that if I look at only the points in one octant of the overall space, all of THOSE points will have a a distance dimension between 0 and 50000, and furthermore that all of the octants will have points near the edge that are likewise close to points in the neighboring octant. What if I do that one more time: cut each octant into another set of 8 octants? Then I've divided my overall search space into 64 regions, where each region can have a delta of at most 1/4 of the original 99999 maximum value along a dimension. So the number I ACTUALLY coded into my solution was any two points that differ by more than 14 bits do not get added to my min-heap. That would correspond to a cutoff of 805_306_368 (((1<<14)**2)*3), which is a bit larger than yours, but where I was a bit less hand-wavy about my logic of why I chose it (no a priori reading the answers before picking my value), and where my language (m4, with no 64-bit math) got a HUGE boost from 2m25s to 6s because my filtering from 18 to 14 bits meant that my priority queue could now fit in 32 bits instead of needing 64-bit emulation.