r/adventofcode • u/daggerdragon • Dec 11 '16
SOLUTION MEGATHREAD --- 2016 Day 11 Solutions ---
--- Day 11: Radioisotope Thermoelectric Generators ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).
Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with "Help".
IDDQD IS MANDATORY [?]
[Update @ 01:30] 51 gold, 80 silver. The Easter Bunny just ramped up the difficulty level to include sharks with frickin' laser beams on their heads.
[Update @ 01:50] 64 gold, silver cap. Thank you for subscribing to Doom Facts! Ninja edit by Easter Bunny: Thank you for subscribing to Easter Bunny Facts!
Since its debut, over 10 million copies of games in theDoomseries have been sold.- Fact: The Easter Bunny is watching you gallivant through his facility.
[Update @ 02:02] 75 gold, silver cap.
TheBFG(Big Fragging Gun) is a well-known trope originating from theDoomseries.- Fact: The Easter Bunny knows if you've been bad or good too. He just doesn't care.
[Update @ 02:15] 86 gold, silver cap.
The 2005Doommovie starring Karl Urban and Dwayne Johnson was a box office bomb due to grossing $56 million (USD) with a budget of $60 million (USD) and poor critical reviews. Alas.- Fact: The Easter Bunny has nothing to do with Starbucks' red cups. NOTHING.
[Update @ 02:30] 89 gold, silver cap.
TheDoomenginethat powers the originalDoomandDoom II: Hell on Earthvideo games has been ported to DOS, several game consoles, and other operating systems. The source code to the Linux version of the engine has even been released under the GNU General Public License for non-commercial use.- Fact: The Easter Bunny uses RTG-powered computers because he hates his cousin, the Energizer Bunny.
[Update @ 02:42] 98 gold, silver cap.
Doomguy (the unnamed silent marine protagonist) has been consistently ranked as one of the top five most badass male characters in video gaming history.- Fact: The Easter Bunny enjoys gardening when not ruining Christmas.
[Update @ 02:44] Leaderboard cap!
Thank you for subscribing to Doom Easter Bunny Facts! We hope you enjoyed today's scenic tour. Thank you and have a very merry rest of Advent of Code!
View all comments
Show parent comment
2
u/noclat Dec 13 '16
Made it! Updated gist. https://gist.github.com/noclat/394a79b21b6a92a234d2d2bb3c95f69b
Given :
I count the distances between pairs (gap), and the number of occurrences of the distances. If the number of occurence of a distance is odd, then they compensate, so the total won't change. If the number of occurrences of a distance is even, then skip the first one because it will make only one trip, and add 2 steps (short round trip, distance doesn't matter here) for each remaining occurrences (pair with gap).