/*本篇为转载,在此申明,具体就是先设定从2以后所有的数都为质数,定为质数的数的倍数则不是质数,慢慢排除后面的数*/ #include<iostream>#include<cstring>using namespace std;const int N = 1300000;//第10万个数为12997 ...
分类:
其他好文 时间:
2016-11-14 00:53:22
阅读次数:
114
然而,他并没有给我解决了我之前素数中的问题, ...
分类:
其他好文 时间:
2016-11-13 22:05:44
阅读次数:
178
Prime Distance Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17021 Accepted: 4536 Description The branch of mathematics called number the ...
分类:
其他好文 时间:
2016-11-13 02:05:00
阅读次数:
253
Humble Numbers Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description A number whose only prime factors are 2,3,5 or 7 is ca ...
分类:
其他好文 时间:
2016-11-12 11:17:46
阅读次数:
215
第一个作业 #include <stdio.h>#include <math.h>int sign(int x);int even(int n);int prime(int m);int countdigit(int number,int digit);int is(int number);int ...
分类:
其他好文 时间:
2016-11-11 00:23:24
阅读次数:
196
【概述】 现场A掉T1和T2,T3骗了10分,总共210,若这是2016的NOIP试题,恐怕要跪。 这次的题难度似乎是倒过来的,T3应该是最简单的,而T2是最难的。 但是我一直在啃T2,以至于最后放弃了T3。 这启示着我们,先把所有题读完是多么的重要。 T1、prime 【题目大意】 给你一个区间, ...
分类:
其他好文 时间:
2016-11-09 19:29:05
阅读次数:
185
cs_Computer Science An Overview _J. Glenn Brookshear _11th Edition “二分法”启发 广义“二分法” 平方根 ...
分类:
其他好文 时间:
2016-11-08 01:05:54
阅读次数:
239
Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the fou ...
分类:
其他好文 时间:
2016-11-06 03:01:41
阅读次数:
198
欧拉筛法求素数 首先,我们知道当一个数为素数的时候,它的倍数肯定不是素数。所以我们可以从2开始通过乘积筛掉所有的合数。 将所有合数标记,保证不被重复筛除,时间复杂度为O(n)。代码比较简单↓_↓ if(i % prime[j] == 0) break;←_←这一步比较难理解解释: 首先,任何合数都能 ...
分类:
其他好文 时间:
2016-11-06 02:50:01
阅读次数:
109