r/adventofcode • • Dec 15 '16

SOLUTION MEGATHREAD --- 2016 Day 15 Solutions ---

--- Day 15: Timing is Everything ---

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".


ZAMENHOFA TAGO ESTAS DEVIGA [?]

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!

5 Upvotes

121 comments sorted by

View all comments

Show parent comment

4

u/gerikson Dec 15 '16

When I read the words "pairwise coprime" I start coding my brute-force solution...

1

u/pedrosorio Dec 15 '16

You can actually code an efficient solution (order of the total size of the discs in the input) without knowing about CRT.

2

u/gerikson Dec 15 '16

Makes sense. As soon as I saw part 2 taking longer than 10s I was frantically thinking ahead on how to solve... combinations maybe?

But then it finished and I decided to cash in my stars and call it a day.

I might look at other solutions as they come in, the alternative sounds interesting.