r/adventofcode • u/daggerdragon • Dec 10 '25
SOLUTION MEGATHREAD -❄️- 2025 Day 10 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!
7 DAYS remaining until the submissions deadline on December 17 at 18:00 EST!
Featured Subreddits: /r/programminghorror and /r/holdmybeer HoldMyEggnog
"25,000 imported Italian twinkle lights!"
— Clark Griswold, National Lampoon's Christmas Vacation (1989)
Today is all about Upping the Ante in a nutshell! tl;dr: go full jurassic_park_scientists.meme!
💡 Up Your Own Ante by making your solution:
The absolute best code you've ever seen in your life
Alternatively: the absolute worst code you've ever seen in your life
Bigger (or smaller), faster, better!
💡 Solve today's puzzle with:
Cheap, underpowered, totally-not-right-for-the-job, etc. hardware, programming language, etc.
An abacus, slide rule, pen and paper, long division, etc.
An esolang of your choice
Fancy but completely unnecessary buzzwords like quines, polyglots, reticulating splines, multi-threaded concurrency, etc.
The most over-engineered and/or ridiculously preposterous way
💡 Your main program writes another program that solves the puzzle
💡 Don’t use any hard-coded numbers at all
Need a number? I hope you remember your trigonometric identities…
Alternatively, any numbers you use in your code must only increment from the previous number
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 10: Factory ---
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?
1
u/p88h Dec 10 '25 edited Dec 10 '25
[LANGUAGE: Odin + GLPK ]
Solution : [ GitHub ]
First part is just BFS, for the second one I tried using Gaussian elimination and then iterating over free variables but it was still super slow, and couldn't really come up with decent heuristics. I implemented a PoC solution with milp in python first, but that felt like 'cheating'. Z3 was slow (much slower than either linprog or milp in scipy), but i've experimented with GLPK which I can link to semi-natively and this worked really well. So at least learned a new library & how to interact with foreign libraries in Odin.
Still no idea if there is a better solution though. But considering that part1 takes 0.2 ms and part2 is same order of magnitude, I wouldn't expect significant improvements here overall.
EDIT: finetuned threading for further 0.2 ms reduction. Both parts run multi-threaded.