![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
容斥定理
长歌丶采薇
这个作者很懒,什么都没留下…
展开
-
HDU - 2204 Eddy's爱好 (容斥定理)
HDU - 2204 Eddy’s爱好 (容斥定理)Ignatius 喜欢收集蝴蝶标本和邮票,但是Eddy的爱好很特别,他对数字比较感兴趣,他曾经一度沉迷于素数,而现在他对于一些新的特殊数比较有兴趣。这些特殊数是这样的:这些数都能表示成M^K,M和K是正整数且K>1。正当他再度沉迷的时候,他发现不知道什么时候才能知道这样的数字的数量,因此他又求助于你这位聪明的程序员,请你帮他用程序解...原创 2019-08-02 18:01:31 · 176 阅读 · 0 评论 -
HDU - 1796 How many integers can you find(容斥定理)
HDU - 1796 How many integers can you find(容斥定理)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 intege...原创 2019-08-02 19:02:13 · 128 阅读 · 0 评论 -
HDU - 4135 Co-prime (容斥原理 求 1-n 与 k互质的数的个数模板)
HDU - 4135 Co-prime (容斥原理 求 1-n 与 k互质的数的个数模板)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-...原创 2019-08-02 20:50:30 · 280 阅读 · 0 评论 -
HDU - 2841 Visible Trees (思维 + 容斥原理)
HDU - 2841 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 tre...原创 2019-08-02 21:39:19 · 145 阅读 · 0 评论 -
HDU - 1695 GCD (容斥原理)
HDU - 1695 GCD (容斥原理)http://acm.hdu.edu.cn/showproblem.php?pid=1695题目大意:给你 a b c d k让你从 (a,b)中选一个x (c,d) 中选一个y 保证 gcd(x,y) =k并且 (3,5) (5,3) 视为一种选择。问:有多少种选择解题思路:gcd(x,y) = k 那我们可以让b和d同时/k就可以...原创 2019-08-03 18:48:00 · 113 阅读 · 0 评论