
容斥定理
文章平均质量分 84
Grady_Ne
这个作者很懒,什么都没留下…
展开
-
Sum HDU - 4407
Sum(HDU 4407) XXX is puzzled with the question below: 1, 2, 3, ..., n (1<=n<=400000) are placed in a line. There are m (1<=m<=1000) operations of two kinds. Operation 1: among the x-th numbe原创 2017-07-31 15:47:20 · 373 阅读 · 0 评论 -
How many integers can you find HDU - 1796
Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer s原创 2017-08-05 15:31:54 · 402 阅读 · 0 评论 -
GCD HDU - 1695
GCD Given 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 and y. Since the number of choices may be very large, y原创 2017-08-02 15:28:18 · 424 阅读 · 1 评论 -
HDU 4135(基本的容斥定理)
Co-prime Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are said to be co-prime or relatively pri原创 2017-07-29 11:23:53 · 317 阅读 · 0 评论 -
Visible Trees HDU2841(容斥定理的简单扩展)
Visible Trees There are many trees forming a m * n grid, the grid starts from (1,1). Farmer Sherlock is standing at (0,0) point. He wonders how many trees he can see. If two trees and Sherlock原创 2017-07-29 11:36:45 · 283 阅读 · 0 评论 -
Eddy's爱好 HDU - 2204
Ignatius 喜欢收集蝴蝶标本和邮票,但是Eddy的爱好很特别,他对数字比较感兴趣,他曾经一度沉迷于素数,而现在他对于一些新的特殊数比较有兴趣。 这些特殊数是这样的:这些数都能表示成M^K,M和K是正整数且K>1。 正当他再度沉迷的时候,他发现不知道什么时候才能知道这样的数字的数量,因此他又求助于你这位聪明的程序员,请你帮他用程序解决这个问题。 为了简化,问题是这样的:给你一个正整数N,确定在1到N之间有多少个可以表示成M^K(K>1)的数。原创 2017-08-07 10:18:47 · 603 阅读 · 0 评论