CS Academy Notes
Round 63: Find Remainder
-
K > max(b(i))
-
a(i) - b(i) >= 0
-
(a(i) - b(i)) % K = 0
-
Consider the GCD of all deltas > 0, and filter buy the constraint that K > max(b(i)).
-
Note that K should be smallest, i.e., GCD % K = 0 !!!
-
So we just bruteforce from 2 to sqrt(GCD), update K by either divisor or GCD/ divisor, as long as they > max(b(i))
Round 63: Graph Game
The key insight is that # of even deg vs has the same oddity as total # of vs!!!
Therefore, suppose N is even, A will always pick the scenario with even # of even degs, B will always pick the scenario with odd # of even degs, i.e., B can not lose => A always loses.
Conversely it is true for the odd case
Round 64: Create Tree
Just check them one by one, because unique path among all = unique path from single node to all!!!
Round 64: Limited Moves
Claim: A will win all cases if N is not a power of 2!!! Proof: we keep removing the least signficant bit 1 in current N, we know that the next move will introduce 1s to the right of the bits B removed, i.e., we can keep goinging, this means as long as B can move, A can move, i.e., A can not lose