![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
长歌丶采薇
这个作者很懒,什么都没留下…
展开
-
HDU - 6237 - A Simple Stone Game( 分解质因子)
HDU - 6237 - A Simple Stone Game( 分解质因子)After he has learned how to play Nim game, Bob begins to try another stone game which seems much easier.The game goes like this: one player starts the game wi...原创 2019-10-14 14:08:17 · 189 阅读 · 0 评论 -
HDU - 5646 DZY Loves Partition (二分 + 数学)
HDU - 5646 DZY Loves Partition (二分 + 数学)DZY loves partitioning numbers. He wants to know whether it is possible to partition n into the sum of exactly k distinct positive integers.After some thinkin...原创 2019-09-25 17:59:19 · 276 阅读 · 1 评论 -
2018宁夏网络赛 B Goldbach (米勒拉宾素数测试)
2018宁夏网络赛 B Goldbach (米勒拉宾素数测试)题目链接题目大意:给你一个偶数n (2<n<=1e18)让你把n分解成两个素数的和。(如果有多个输出任意一个)解题思路:米勒拉宾素数测试板子这个板子可以在 log 级的时间内判断一个数是不是素数。 用于判断大数是不是素数。AC代码:#include<bits/stdc++.h>#define ...原创 2019-09-05 22:05:46 · 201 阅读 · 0 评论 -
2019牛客暑假多校第十场 D——Han Xin and His Troops(拓展中国剩余定理)
2019牛客暑假多校第十场 D——Han Xin and His Troops(拓展中国剩余定理)链接:https://ac.nowcoder.com/acm/contest/890/D来源:牛客网Han Xin was a military general who served Liu Bang during the Chu-Han contention and contributed g...原创 2019-08-18 13:32:16 · 253 阅读 · 0 评论 -
2019牛客暑期多校训练营(第九场——B Quadratic equation 二次剩余定理)
链接:https://ac.nowcoder.com/acm/contest/889/B来源:牛客网题目描述Amy asks Mr. B problem B. Please help Mr. B to solve the following problem.Let p = 1000000007.Given two integers b and c, please find two in...原创 2019-08-15 21:02:17 · 196 阅读 · 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 · 122 阅读 · 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 · 147 阅读 · 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 · 286 阅读 · 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 · 148 阅读 · 0 评论 -
HDU - 2204 Eddy's爱好 (容斥定理)
HDU - 2204 Eddy’s爱好 (容斥定理)Ignatius 喜欢收集蝴蝶标本和邮票,但是Eddy的爱好很特别,他对数字比较感兴趣,他曾经一度沉迷于素数,而现在他对于一些新的特殊数比较有兴趣。这些特殊数是这样的:这些数都能表示成M^K,M和K是正整数且K>1。正当他再度沉迷的时候,他发现不知道什么时候才能知道这样的数字的数量,因此他又求助于你这位聪明的程序员,请你帮他用程序解...原创 2019-08-02 18:01:31 · 199 阅读 · 0 评论