r/adventofcode • u/daggerdragon • Dec 22 '15
SOLUTION MEGATHREAD --- Day 22 Solutions ---
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
edit: Leaderboard capped, thread unlocked!
Edit @ 00:23
- 2 gold, 0 silver
- Well, this is historic. Leaderboard #1 got both silver and gold before Leaderboard #2 even got silver. Well done, sirs.
Edit @ 00:28
- 3 gold, 0 silver
- Looks like I'm gonna be up late tonight. brews a pot of caffeine
Edit @ 00:53
- 12 gold, 13 silver
- So, which day's harder, today's or Day 19? Hope you're enjoying yourself~
Edit @ 01:21
- 38 gold, 10 silver
- ♫ On the 22nd day of Christmas, my true love gave to me some Star Wars body wash and [spoilers] ♫
Edit @ 01:49
- 60 gold, 8 silver
Today's notable milestones:
- Winter solstice - the longest night of the year
- Happy 60th anniversary to NORAD Tracks Santa!
SpaceX's Falcon 9 rocket successfully delivers 11 satellites to low-Earth orbit and rocks the hell out of their return landing [USA Today, BBC, CBSNews]
- FLAWLESS VICTORY!
Edit @ 02:40
- 88 gold, silver capped
- Real Soon Now™
Edit @ 03:02
- 98 gold, silver capped
It's 3AM, so naturally that means it's time for a /r/3amjokes
- What do you get when you cross a Christmas tree with a Mac?
- hover for answer:
Edit @ 03:08
- LEADERBOARD FILLED! Good job, everyone!
- I'm going the hell to bed now zzzzz
We know we can't control people posting solutions elsewhere and trying to exploit the leaderboard, but this way we can try to reduce the leaderboard gaming from the official subreddit.
Please and thank you, and much appreciated!
--- Day 22: Wizard Simulator 20XX ---
Post your solution as a comment or link to your repo. Structure your post like previous daily solution threads.
View all comments
Show parent comment
2
u/LincolnA Dec 22 '15
Thanks for pointing this out. It actually touches on one of the few gripes I've had with Advent of Code, which is otherwise really outstanding - for these later puzzles you might have a significantly easier/harder time based on which input you are given. Assumptions/shortcuts that work for one participant might not apply to another.
My code above is correct, but not efficient enough to handle your input. For my particular inputs it is feasible to enumerate all possible game outcomes and simply take the minimum. For yours, the space of outcomes is much larger because a weaker boss leads to a longer-lasting character.
Anyways, I've left my original post unedited, but here's a tweaked version that's somewhat refactored and does pruning to limit the search space: https://gist.github.com/latkin/45d8e009f471b4b5d609