this post was submitted on 10 Dec 2025
13 points (100.0% liked)

Advent Of Code

1213 readers
1 users here now

An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!

Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Everybody Codes is another collection of programming puzzles with seasonal events.

EC 2025

AoC 2025

Solution Threads

M T W T F S S
1 2 3 4 5 6 7
8 9 10 11 12

Visualisations Megathread

Rules/Guidelines

Relevant Communities

Relevant Links

Credits

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

console.log('Hello World')

founded 2 years ago
MODERATORS
 

Day 10: Factory

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

you are viewing a single comment's thread
view the rest of the comments
[โ€“] EnEnCode@programming.dev 2 points 2 weeks ago* (last edited 2 weeks ago) (3 children)

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

(/relieving)

I would never have solved this if it weren't for AoC being only 12 days. I don't know if that was a good thing with how much this took out of me.

  • Written in the Really Ultimate Simplex Tableau (Rust) programming language
  • Over 600 lines (so long it didn't fit without using paste)
  • Two-phase simplex fully implemented, refactored to handle inequalities as well as equalities (you need inequalities during branch-and-cut)
  • Custom Fraction struct because floating-point made me sad (just like every other time I try to use it)
  • The hackiest branch-and-cut implementation ever (really, you had to add inputs with non-integer optima just to make life harder?)
  • Hideously unreadable use of iterators
  • Probably still filled with lingering bugs
  • All of the comments telling the story of my deteriorating mental state intact
  • Part 1 included as a bonus
  • Somehow, actually reasonably performant (37.1 +/- 0.3 ms)

Solution

[โ€“] CameronDev@programming.dev 1 points 2 weeks ago (2 children)

I dunno how topaz is meant to work, but I get an error about failing to decompress data on mobile Firefox, is the link right?

[โ€“] EnEnCode@programming.dev 2 points 2 weeks ago (1 children)

Lemmy uses %20 in the URL for every '+' character and paste doesn't account for that. I think if you copy-replace all of that, it should work.

[โ€“] CameronDev@programming.dev 1 points 2 weeks ago

Ah, bit hard to do on mobile, but good to know.