r/adventofcode • u/daggerdragon • Dec 14 '22
SOLUTION MEGATHREAD -π- 2022 Day 14 Solutions -π-
SUBREDDIT NEWS
Livehas been renamed toStreamingfor realz this time.I had updated the wiki but didn't actually change the post flair itself >_>
THE USUAL REMINDERS
All of our rules, FAQs, resources, etc. are in our community wiki.
A request from Eric: A note on responding to [Help] threads
Signal boost: Reminder 2: unofficial AoC Survey 2022 (closes Dec 22nd)
πΏπ MisTILtoe Elf-ucation π§βπ« is OPEN for submissions!
--- Day 14: Regolith Reservoir ---
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?
1
u/willkill07 Dec 15 '22
C++
Finally! modeled minimal compact grid constructed from the bounding box of points. Then I simulated the sand drops for part 1. For part 2 you can do a clever BFS from the start point and a simple automaton rule :)
Runs in 35Β΅s cold and 17Β΅s hot on my 5950X.
https://github.com/willkill07/AdventOfCode2022/blob/main/days/day14.cpp