Expand description
§Restroom Redoubt
For part one we jump straight to the final position by multiplying the velocity by 100. The image appears in part two when the positions of all robots are unique.
The x coordinates repeat every 101 seconds and the y coordinates repeat every 103 seconds.
First we check for times when the robot x coordinates could form the left and right columns
of the tree’s bounding box. This gives a time t
mod 101.
Then we check the y coordinates looking for the top and bottom rows of the bounding box,
giving a time u
mod 103.
Using the Chinese Remainder Theorem we combine the two times into a single time mod 10403 that is the answer.
Functions§
Type Aliases§
- Robot 🔒