#chinese-remainder-theorem
CF 906D - Power Tower
CF 906D - Power Tower Rating: 2700 Tags: chinese remainder theorem, math, number theory Solve time: 14m 47s Verified: yes Solution Problem Understanding We are asked to compute a "power tower" modulo a given number. Conceptually, imagine a sequence of rocks, each with a positive integer power. To construct the tower from rocks numbered l through r , we start from the top rock r and work down to l...
CF 1500B - Two chandeliers
CF 1500B - Two chandeliers Rating: 2200 Tags: binary search, brute force, chinese remainder theorem, math, number theory Solve time: 1m 3s Verified: no Solution Problem Understanding We have two cyclic sequences of colors. The first chandelier repeats an array a of length n , and the second chandelier repeats an array b of length m . On day d , the first chandelier shows position (d - 1) mod...
CF 2034A - King Keykhosrow's Mystery
CF 2034A - King Keykhosrow's Mystery Rating: 800 Tags: brute force, chinese remainder theorem, math, number theory Solve time: 1m 20s Verified: yes Solution Problem Understanding The problem asks us to find a number that satisfies two properties relative to two given numbers, $a$ and $b$. Specifically, we want the smallest integer $m$ such that $m$ is at least as large as one of the two numbers and the remainder...