摘要:
求最小公倍数其实就是求最大公约数。为什么呢? 我们可以假想这两个数m和n,假设m和n的最大公约数是a。那么我们可以这样写: m = b * a; n = c * a; 所以m和n的最小公倍数就应该是a*b*c,就是m * n / a,其中m和n是已知的,而a就是那个需要求解的最大公约数。 所以结合辗 阅读全文
摘要:
Color the fence 时间限制:1000 ms | 内存限制:65535 KB 难度:2 Color the fence 时间限制:1000 ms | 内存限制:65535 KB 难度:2 Tom has fallen in love with Mary. Now Tom wants to 阅读全文