diff options
author | Adam Spragg <adam@spra.gg> | 2022-12-11 18:42:43 +0000 |
---|---|---|
committer | Adam Spragg <adam@spra.gg> | 2022-12-11 18:42:43 +0000 |
commit | 2e4bd3352ccde9b5380945bf483002416a50d71f (patch) | |
tree | b5a06d4ae3dd2b0383ee8ef0cd6bbf9bc423b7ce /makefile | |
parent | e9700bcb5457ccc137956558b1f4eb780a748b0d (diff) |
Solve puzzle 11 part 2
The trick is that we don't care about how much worry there is, we only
care how much worry modulo the test divisor, to figure out which monkey
gets the item next.
Now, I know that addition is stable under modulo arithmetic, but I seem
to remember that multiplication is stable under modulo arithmetic also?
(I think public key cryptography relies on this?)
So, by only keeping track of our worry, modulo the product of all the
test divisors, everything should still work correctly?
At least, that's what I tried, and it stopped all the overflow, and I
seemed to get the right numbers according to the expected test results,
and my final answer was also accepted. So I guess it does work
correctly!
Diffstat (limited to 'makefile')
0 files changed, 0 insertions, 0 deletions