摘要:
Input A B MC = 1e9The equation of p2 winning is (Na * C + Nb) % M == 0, that's (Na * (C % M) + Nb % M) % M == 0Further, p1 controls M1 = (Na * (C % M)) % M, p2 controls M2 =Nb % MIf B >= M - 1, P1 has no chances to win, because P2 can always pick a number makes (M2 + M1) % M == 0If A == B == 阅读全文