2013年8月21日

SPOJ 7001. Visible Lattice Points (莫比乌斯反演)

摘要: 7001. Visible Lattice PointsProblem code: VLATTICEConsider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible from corner at (0,0,0) ? A point X is visible from point Y iff no other lattice point lies on the segment joining X and Y.Input 阅读全文

posted @ 2013-08-21 21:14 kuangbin 阅读(1655) 评论(2) 推荐(0) 编辑

BZOJ 2301: [HAOI2011]Problem b (莫比乌斯反演)

摘要: 2301: [HAOI2011]Problem bTime Limit:50 SecMemory Limit:256 MBSubmit:436Solved:187[Submit][Status]Description对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x,y)函数为x和y的最大公约数。Input第一行一个整数n,接下来n行每行五个整数,分别表示a、b、c、d、kOutput共n行,每行一个整数表示满足要求的数对(x,y)的个数Sample Input22 5 1 5 11 5 1 5 2 Sample Output1 阅读全文

posted @ 2013-08-21 21:12 kuangbin 阅读(4636) 评论(0) 推荐(0) 编辑

HDU 1695 GCD (莫比乌斯反演)

摘要: GCDTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4291Accepted Submission(s): 1502Problem DescriptionGiven 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x an 阅读全文

posted @ 2013-08-21 21:10 kuangbin 阅读(8238) 评论(0) 推荐(2) 编辑

导航

JAVASCRIPT: