[CodeForces] The Meaningless Game
作者:互联网
S: the set of numbers said by player 1;
P: the set of numbers said by player 2;
S^2 * P = a;
S * P^2 = b;
a * b = (S * P)^3, so a * b must be a perfect cubic number. Binary search to check this.
Let X be the cubic root of a * b, X = S * P.
In order to have a valid S and P, then a must be divisible by X and b must be divisible by X.
标签:set,cubic,divisible,CodeForces,Meaningless,player,Game,said,must 来源: https://www.cnblogs.com/lz87/p/15816201.html