
LCM or GCD
mowayao
这个作者很懒,什么都没留下…
展开
-
UVa10325 - The Lottery(容斥+最小公倍数)
The Lottery The Sports Association of Bangladesh is in great problem with their latest lottery 'Jodi laiga Jai'. There are so many participants this time that they cannot manage all the nu原创 2014-08-25 16:57:31 · 773 阅读 · 0 评论 -
UVa 12716 GCD XOR (简单证明)
题意: 问 gcd(i,j) = i ^ j 的对数(j 思路:容易想到 形如 (2,3) (4,5).....这种互质相邻且二进制位数相同的数一定满足要求。 那么对于gcd为2情况进行分析: 从gcd(a,b) = 2得到a/2,b/2互质,可以想到a/2与b/2相差只能是1,因为要使a^b = 2 a,b只有在第1位有差别,即差别为2,如果a/2与b/2相差超过1,那么a,b就不原创 2014-10-15 14:19:28 · 1299 阅读 · 0 评论