码迷,mamicode.com
首页 >  
搜索关键字:prime    ( 2475个结果
2136 Largest prime factor(打表)
Problem DescriptionEverybody knows any number can be combined by the prime number.Now, your task is telling me what position of the largest prime fact...
分类:其他好文   时间:2015-08-05 20:03:57    阅读次数:128
UVA 10200 Prime Time(简单素数判定预处理)
Euler is a well-known matematician, and, among many other things, he discovered that the formula n 2 + n + 41 produces a prime for 0 ≤ n #include #inc...
分类:其他好文   时间:2015-08-05 19:56:48    阅读次数:134
neuoj 1122 Faster Pipe
裸最小生成树 注意重边 #include #include #include #include int visited[105],map[105][105],lowcost[105],n,m; int prime(int v) {     int i,j,minn,k,sum=0;     for(i=1;i      lowcost[i]=map[v][i]; ...
分类:其他好文   时间:2015-08-05 18:33:38    阅读次数:139
codeforces 546D Soldier and Number Game
题意就是求a!/b!的素因子的个数 也就是a!的-b!的 重复的算多次 #include #include #include #include using namespace std; const int maxn = 5000010; bool is_prime[maxn]; int p, mpf[maxn], nf[maxn], sum[maxn]; void...
分类:其他好文   时间:2015-08-05 14:51:36    阅读次数:83
Leetcode-204(Java) Count Primes
Description:Count the number of prime numbers less than a non-negative number,n.传送门:https://leetcode.com/problems/count-primes/尽可能把查找次数缩小,直接用双重for会超时。...
分类:编程语言   时间:2015-08-05 10:27:34    阅读次数:366
杭电1016--Prime Ring Problem(Dfs)
Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34108Accepted Submission(s): 150...
分类:其他好文   时间:2015-08-05 10:24:30    阅读次数:115
204 Count Primes
Description:Count the number of prime numbers less than a non-negative number,n.Credits:Special thanks to@mithmattfor adding this problem and creatin....
分类:其他好文   时间:2015-08-05 00:51:33    阅读次数:104
练习1
1.写个程序,接受用户输入数字,并进行校验,非数字给出错误提示,然后重新等待用户输入。2.根据用户输入数字,输出从0到该数字之间所有的素数。(只能被1和自身整除的数为素数)num=int(num)i=2is_prime=Falsewhilei<num:foriiinrange(2,i):ifi%ii==0:is_prime=Falsebreakel..
分类:其他好文   时间:2015-08-04 23:16:28    阅读次数:154
hdu 1164 Eddy's research I
Problem DescriptionEddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided int...
分类:其他好文   时间:2015-08-04 15:23:26    阅读次数:95
Prime Ring Problem HDU 杭电1016
Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime...
分类:其他好文   时间:2015-08-04 11:10:54    阅读次数:104
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!