————数论————
1
BigZong
这个作者很懒,什么都没留下…
展开
-
POJ - 2429 GCD & LCM Inverse
题意:给定两个范围是2^63的两个数,分别代表gcd(a,b)和lcm(a,b)(最大公约数和最小公倍数),让求和最小的a,b.分析:通过最大公约数求最小公倍数的方法为:lcm(a,b)=a*b/gcd(a,b).那么通过题目中给出的条件,我们可以知道要求的a和b满足a*b=lcm(a,b)*gcd(a,b).现在把问题简化成找到任意一组a b使得题目要求的条件成立:a=...原创 2020-04-09 17:47:27 · 211 阅读 · 0 评论 -
CodeForces - 1245A Good ol' Numbers Coloring
Consider the set of all nonnegative integers: 0,1,2,…. Given two integers a and b (1≤a,b≤104). We paint all the numbers in increasing number first we paint 0, then we paint 1, then 2 and so on.E...原创 2019-11-07 17:09:28 · 255 阅读 · 0 评论 -
Sad powers(CF 955Div2 C 二分+map+思路+数学)
You're given Q queries of the form (L, R).For each query you have to find the number of such x that L ≤ x ≤ R and there exist integer numbers a > 0, p > 1 such that x = ap.InputThe first ...原创 2019-11-01 19:20:46 · 232 阅读 · 0 评论 -
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, you'r...原创 2019-11-01 08:59:18 · 122 阅读 · 0 评论 -
POJ 2407 Relatives(欧拉函数)
Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such ...原创 2019-10-31 19:19:49 · 168 阅读 · 0 评论 -
Smith Numbers(素因子分解)
Smith NumbersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15619 Accepted: 5226DescriptionWhile skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh Un...原创 2019-10-31 17:58:09 · 130 阅读 · 0 评论 -
抽屉原理
五个物品分给四个人,保证每个人都能够分得物品,那么一定有一个人会分得两个物品。这就是我们所说的抽屉原理。抽屉原理的一般含义为:“如果每个抽屉代表一个集合,每一个苹果就可以代表一个元素,假如有n+1或多于n+1个元素放到n个集合中去,其中必定至少有一个集合里有两个元素。” 抽屉原理有时也被称为鸽巢原理(“如果有五个鸽子笼,养鸽人养了6只鸽子,那么当鸽子飞回笼中后,至少有一个笼子中装有2只鸽子...原创 2019-10-31 16:30:46 · 5962 阅读 · 0 评论 -
HDU 1370-Biorhythms + 中国剩余定理
本文分为两个部分:1、HDU1370题解,2、中国剩余定理的推导。目录:1:HDU-13702:中国剩余定理的推导1:HDU-1370Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6122Accepte...原创 2019-08-06 09:49:58 · 265 阅读 · 0 评论 -
一个数的因子个数求解公式
目录概念:举例:证明:概念:对于某一个大于1的数,我们对其进行素因子分解,得到的结果为:其正因字的个数为:举例:99099=3^2 * 7 * 11^2 * 13其正因子个数为 3*2*3*2=36证明:也就是说,对于每一个P的指数,都有0-s范围的数可以进行选择。...原创 2019-07-27 16:43:32 · 7081 阅读 · 1 评论 -
HDU 1211-RSA (数论)
目录题目描述:题意:题解:1:求d:2:求n:代码:题目描述:Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3303Accepted Submission(s): 2202P...原创 2019-07-31 10:25:38 · 189 阅读 · 0 评论