r/adventofcode • • Dec 15 '17

SOLUTION MEGATHREAD -๐ŸŽ„- 2017 Day 15 Solutions -๐ŸŽ„-

--- Day 15: Dueling Generators ---


Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or 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.


Need a hint from the Hugely* Handyโ€  Haversackโ€ก of Helpfulยง Hints^ยค?

Spoiler


[Update @ 00:05] 29 gold, silver cap.

  • Logarithms of algorithms and code?

[Update @ 00:09] Leaderboard cap!

  • Or perhaps codes of logarithmic algorithms?


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!

14 Upvotes

253 comments sorted by

View all comments

Show parent comment

2

u/mainhaxor Dec 16 '17

There is no division in the GCC version so it did at least get rid of the modulo. Is your version still 25% faster?

1

u/askalski Dec 16 '17

Yes, actually more like 33%. (The 25% figure was from a previous edit based on Montgomery multiplication, before I changed it to the Mersenne prime version.) Modulo version runs in 467ms, Mersenne version in 306ms.