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
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
基本事务操作: 任何数据库都必须要保证一种原子执行操作:最基本的原子执行操作肯定是需要提供: 举一个例子来说明: 当对某个Key 做一个统计: 可能不同的Client做它那部分的统计,一段时间后,服务器端需要得出那个key的具体值 Client1: GET number number = numbe...
分类:
其他好文 时间:
2014-08-30 17:36:19
阅读次数:
771
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
由算术基本定理,直接使用公式就好#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
【题意简述】:给出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
水,用来熟悉内容#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
其实就是筛选素数。如,若能被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全排列输出: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
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