r/adventofcode • u/daggerdragon • Dec 24 '22
SOLUTION MEGATHREAD -π- 2022 Day 24 Solutions -π-
All of our rules, FAQs, resources, etc. are in our community wiki.
UPDATES
[Update @ 00:21:08]: SILVER CAP, GOLD 47
Lord of the Rings has elves in it, therefore the LotR trilogy counts as Christmas movies.
change_my_mind.meme
AoC Community Fun 2022:
πΏπ MisTILtoe Elf-ucation π§βπ«
Community voting is OPEN!
18 hours remaining until voting deadline on December 24 at 18:00 EST
Voting details are in the stickied comment at the top of the -βοΈ- Submissions Megathread -βοΈ-
--- Day 24: Blizzard Basin ---
Post your code solution in this megathread.
Read the full posting rules in our community wiki before you post!
Include what language(s) your solution uses
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?
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:26:48, megathread unlocked!
23
Upvotes
10
u/SLiV9 Dec 24 '22
Rust
Both parts in ~1ms without any heap allocations. For this one I took roughly the same approach as yesterday's challenge: each row is a
u128, and luckily there were only 122 columns this time. And I used Shroedinger's Quantum Elves(tm): elves exist in multiple places at the same time and each step I move elves to all four directions, and then kill the ones that end up in a storm or inside a wall. I thought the solution would require the fact that the storms at time t are in the same positions as time t + N, but I didn't end up using that.All in all this felt like a breeze compared to the last few. (Or perhaps a nice little early Christmas gift from Eric!)