这样做倒是挺简单的,怎么容易怎么做#include#include#define maxn 1000000int isprime[maxn+10];int prime[maxn/10];int count;int n;int main(){ while(scanf("%d",&n)!=EOF)...
分类:
其他好文 时间:
2015-11-04 00:22:49
阅读次数:
194
1 #include 2 using namespace std; 3 const int N = 200; 4 int prime[N], e[N], d[N], tot, phi[N]; 5 bool not_p[N]; 6 inline void pre(){ 7 not_p[1] ...
分类:
其他好文 时间:
2015-11-03 21:08:40
阅读次数:
399
Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem and creat...
分类:
其他好文 时间:
2015-11-03 10:28:12
阅读次数:
269
思路:质因子累乘的值即为所求#include#include#include#include#include#includeusing namespace std;typedef long long LL;int prime(LL n);int main(){ LL n,ans,m; w...
分类:
其他好文 时间:
2015-10-31 17:07:49
阅读次数:
142
int prime[N];bool Isprime[N];void Prime(){ int k = 0; memset(Isprime, true, sizeof(Isprime)); Isprime[1] = false; for(int i = 2 ; i < N ; ...
分类:
其他好文 时间:
2015-10-30 20:40:14
阅读次数:
239
我特么真是醉了;题意:给你两个四位数,问你能不能从一个数搜到另一个数,每次只改变其中的一位,并且保证每次得到的这个数是素数;如果有,给出最短路径,如果没有,输出“impossible”AC代码:#include #include #include #include #include #include...
分类:
其他好文 时间:
2015-10-30 01:59:43
阅读次数:
209
描述A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, ...
分类:
其他好文 时间:
2015-10-29 06:08:14
阅读次数:
151
Page.Response.Redirect("http://ws-prime-03/sites/heng/_layouts/15/ReportServer/RSViewerPage.aspx?ParamMode=Hidden&rv:RelativeReportUrl=/sites/heng/Rep...
分类:
Web程序 时间:
2015-10-26 12:11:22
阅读次数:
184
Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35961Accepted Submission(s): 158...
分类:
其他好文 时间:
2015-10-23 01:28:16
阅读次数:
252
题意:一个4位的素数每次变动一个数位,中间过程也要上素数,问变成另一个的最小步数。线性筛一遍以后bfs就好。我写的双向,其实没有必要。#include#include#include#include#include#include#include#include#include#include#in...
分类:
其他好文 时间:
2015-10-20 22:47:15
阅读次数:
191