码迷,mamicode.com
首页 >  
搜索关键字:bear and prime numbe    ( 2904个结果
swift读取字典中最大的数组和数组最大值
letshabiNumbers=["prime":[2,3,5,7,11,13],"Fibonacci":[1,1,2,3,4,8],"Square":[1,4,9,16,25],]varlargest=0varbigerkind=0vartemp=0vartag=1;vari=0;vars=""for(kind,numbers)inshabiNumbers{/*fornumberinnumbers{ifnumber>largest{largest=number}}*/fornumberinnumber..
分类:编程语言   时间:2014-09-01 15:54:43    阅读次数:173
Codeforces #264 (Div. 2) D. Gargari and Permutations
Gargari got bored to play with the bishops and now, after solving the problem about them, he is trying to do math homework. In a math book he have found k permutations. Each of them consists of numbe...
分类:其他好文   时间:2014-09-01 00:28:22    阅读次数:328
REDIS 事务机制
基本事务操作: 任何数据库都必须要保证一种原子执行操作:最基本的原子执行操作肯定是需要提供: 举一个例子来说明: 当对某个Key 做一个统计: 可能不同的Client做它那部分的统计,一段时间后,服务器端需要得出那个key的具体值 Client1: GET number number = numbe...
分类:其他好文   时间:2014-08-30 17:36:19    阅读次数:771
UVA - 11762 Race to 1
Dilu have learned a new thingabout integers, which is - any positive integer greater than 1 can be divided byat least one prime number less than or equal to that number. So, he is nowplaying with this...
分类:其他好文   时间:2014-08-29 22:45:39    阅读次数:366
HDU 1215
由算术基本定理,直接使用公式就好#include #include #include #include using namespace std;const int Maxp=1000;bool isprime[Maxp];int prime[Maxp],nprime;void Doprime(){ ...
分类:其他好文   时间:2014-08-29 10:52:17    阅读次数:179
POJ 1595 素数打表水题
【题意简述】:给出N和C,让我们求出N以内的包括N的素数,然后根据若N以内的素数为奇数个,就将中间2*c-1个素数输出;若为偶数个,就将中间2*c个素数输出。 【分析】:只要题意理解就简单了。 详见代码: // 224K 16Ms #include using namespace std; #define N 2000 bool isprime[N]; int prime[N],nprime...
分类:其他好文   时间:2014-08-28 08:29:39    阅读次数:172
HDU 2098
水,用来熟悉内容#include #include #include #include #include using namespace std;const int Max=10050;bool prime[Max+10];int main(){ memset(prime,true,sizeof(p...
分类:其他好文   时间:2014-08-27 21:50:58    阅读次数:162
NEFU 2
其实就是筛选素数。如,若能被2是质数,则2的倍数全是合数。如此循环。#include #include #include #include #include using namespace std;const int Max=(1<<24);bool prime[Max+10];bool judge...
分类:其他好文   时间:2014-08-27 20:27:38    阅读次数:191
n全排列输出和 n个数的组合(数字范围a~b)
n全排列输出:int WPermutation(int num, bool bRepeat)num表示num全排列bRepeat标志是否产生重复元素的序列。int Permutation(int n, int* A, int cur, bool bRepeat) { static int numbe...
分类:其他好文   时间:2014-08-26 19:19:16    阅读次数:228
UVA - 1404 Prime k-tuple (素数筛选)
Description {p1,..., pk : p1 < p2 pk} is called a prime k -tuple of distance s if p1, p2,..., pk are consecutive prime numbers and pk - p1 = s . For example, with k = 4 , s = 8 , {11, 13, 1...
分类:其他好文   时间:2014-08-26 17:25:13    阅读次数:217
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!