![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
巧克力Fyy
路漫漫其修远兮,吾将上下而求索。
展开
-
UVA10179 Irreducable Basic Fractions【数论 欧拉函数】
题目链接:10179 - Irreducable Basic FractionsA fraction m / n is basic if 0 ≤ m < n and it is irreducible if gcd(m, n) = 1. Given a positive integer n, in this problem you are required to find out the...原创 2018-07-24 16:52:44 · 228 阅读 · 0 评论 -
PTA 1007 素数对猜想 (20 分)【素数判定】
1007 素数对猜想 (20 分)让我们定义dn为:dn=pn+1−pn,其中pi是第i个素数。显然有d1=1,且对于n>1有dn是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。现给定任意正整数N(<105),请计算不超过N的满足猜想的素数对的个数。输入格式:输入在一行给出正整数N。输出格式:在一行中...原创 2019-02-11 13:17:18 · 255 阅读 · 0 评论 -
Bailian3177 判决素数个数【素数判定】
原题链接:判决素数个数总时间限制: 1000ms内存限制: 65536kB描述输入两个整数X和Y,输出两者之间的素数个数(包括X和Y)。输入两个整数X和Y(1 <= X,Y <= 105)。输出输出一个整数,表示X,Y之间的素数个数(包括X和Y)。样例输入1 100样例输出25 题记:这道题看似简单却有个小坑,x并...原创 2018-10-09 21:49:05 · 405 阅读 · 0 评论 -
CCF NOI1066. 素数对【数论 素数判定】
时间限制: 1000 ms 空间限制: 262144 KB 具体限制 题目描述两个相差为2的素数称为素数对,如5和7,17和19等,本题目要求找出所有两个数均不大于n的素数对。输入一个正整数n。1<=n<=10000。输出按照从小到大的顺序输出所有小于等于n的素数对。每对素数对输出一行,中间用单个空格隔开。若没有找到任何素数对,输出empty。样例输入...原创 2018-09-27 22:01:47 · 512 阅读 · 0 评论 -
UVA10104 Euclid Problem【数论 扩展欧几里得算法】
题目链接:10104 - Euclid ProblemFrom Euclid it is known that for any positive integers A and B there exist such integers X and Y that AX + BY = D, where D is the greatest common divisor of A and B. The p...原创 2018-07-22 21:08:36 · 279 阅读 · 0 评论 -
51Nod-1011 最大公约数GCD【数论 欧几里得算法】
题目链接:1011 最大公约数GCD基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题输入2个正整数A,B,求A与B的最大公约数。Input2个数A,B,中间用空格隔开。(1<= A,B <= 10^9)Output输出A与B的最大公约数。Input示例30 105Output示例15题记:欧几里得算法是...原创 2018-07-22 20:47:50 · 178 阅读 · 0 评论 -
AOJ0005 GCD and LCM【数论 GCD&LCM】
题目链接:GCD and LCM(原题) GCD and LCM(VJ) Time Limit : 1 sec, Memory Limit : 131072 KBProblem DescriptionWrite a program which computes the greatest common divisor (GCD) and the least commo...原创 2018-07-22 20:34:48 · 204 阅读 · 0 评论 -
HDU2099 整除的尾数【数论 模除】
题目链接:整除的尾数Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 48132 Accepted Submission(s): 20469 Problem Description 一个整数,只知道前...原创 2018-07-22 20:08:01 · 146 阅读 · 0 评论 -
HDU5150 Sum Sum Sum【数论 筛选法】
题目链接:Sum Sum SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1590 Accepted Submission(s): 931 Problem Description We cal...原创 2018-07-22 18:29:06 · 178 阅读 · 0 评论 -
HDU1420 Prepared for New Acmer【数论 快速模幂】
题目链接:Prepared for New AcmerTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12454Accepted Submission(s): 4776 Problem Descripti...原创 2018-07-22 18:15:28 · 229 阅读 · 0 评论 -
HDU2012 素数判定【数论 素数判定】
题目链接:素数判定Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 169265 Accepted Submission(s): 59989 Problem Description 对于表达式n^2+...原创 2018-07-22 17:44:40 · 700 阅读 · 0 评论 -
数论总结
数论:研究整数规律(待补充)1.快速(模)幂核心代码:typedef unsigned long long ULL; ULL powermod(ULL a, ULL n, ULL m) { ULL res = 1; while(n) { if(n & 1) { // n % 2 == 1 ...原创 2018-07-20 16:44:43 · 132 阅读 · 0 评论 -
POJ1006 UVA756 UVALive5421 Biorhythms【数论 中国剩余定理】
题目链接:BiorhythmsTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 145581 Accepted: 46917 DescriptionSome people believe that there are three cycles in a person's life t...原创 2018-07-24 17:27:34 · 195 阅读 · 0 评论 -
PTA 1013 数素数 (20 分)【素数判定】
1013 数素数 (20 分)令 Pi 表示第 i 个素数。现任给两个正整数 M≤N≤104,请输出 PM 到 PN 的所有素数。输入格式:输入在一行中给出 M 和 N,其间以空格分隔。输出格式:输出从 PM 到 PN 的所有素数,每 10 个数字占 1 行,其间以空格分隔,但行末不得有多余空格。输入样例:5 27输出样例:...原创 2019-02-12 16:12:31 · 697 阅读 · 0 评论