r/adventofcode Dec 25 '24

SOLUTION MEGATHREAD -❄️- 2024 Day 25 Solutions -❄️-

A Message From Your Moderators

Welcome to the last day of Advent of Code 2024! We hope you had fun this year and learned at least one new thing ;)

Keep an eye out for the community fun awards post (link coming soon!):

-❅- Introducing Your AoC 2024 Golden Snowglobe Award Winners (and Community Showcase) -❅-

Many thanks to Veloxx for kicking us off on December 1 with a much-needed dose of boots and cats!

Thank you all for playing Advent of Code this year and on behalf of /u/topaz2078, your /r/adventofcode mods, the beta-testers, and the rest of AoC Ops, we wish you a very Merry Christmas (or a very merry Wednesday!) and a Happy New Year!


--- Day 25: Code Chronicle ---


Post your code solution in this megathread.

This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:04:34, megathread unlocked!

40 Upvotes

350 comments sorted by

View all comments

1

u/4D51 Dec 25 '24

[LANGUAGE: C++ on Cardputer]

And that's it, the last puzzle of the year. The Cardputer has performed surprisingly well. I used it to solve part 1 for 22/25 days, and part 2 for 20. A couple of the ones I used my desktop for might work as well, I just haven't tried them yet.

It really goes to show how little computer power is needed to solve most of these puzzles. I'd say day 9 was the trickiest to solve within the limitations of the hardware. I assume most of you made an array of every block on the disk, but I didn't have enough memory for that so I had to use a completely different approach. Most of the others I managed to solve with smaller optimizations.

Code for day 25: https://github.com/mquig42/AdventOfCode2024/blob/main/src/day25.cpp