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
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 int main(){ puts("n e");puts("- -----------");puts("0 1"); double ans=1.0,f=1.0; for(int i=1;i<=9;i++){ if(i==1)...
分类:
其他好文 时间:
2014-08-29 19:41:28
阅读次数:
162
TOYS
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 10544
Accepted: 5063
Description
Calculate the number of toys that land in each bin of a partitioned toy...
分类:
其他好文 时间:
2014-08-29 18:19:48
阅读次数:
300
求数字的绝对值,vc++提供的库函数的支持,当必须包含:#include
其中又分好几种类型:abs、_abs64、fabs、fabsf、labs、_cabs。详细说明如下:
//Calculate the absolute value.
int abs(
int n
);
long abs(
long n
); // C++ only
double abs...
分类:
其他好文 时间:
2014-08-29 11:01:47
阅读次数:
245
由算术基本定理,直接使用公式就好#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
Problem code: LCMSUMGiven n, calculate the sum LCM(1,n) + LCM(2,n) + .. + LCM(n,n), where LCM(i,n) denotes the Least Common Multiple of the integers i...
分类:
其他好文 时间:
2014-08-28 22:23:56
阅读次数:
347
total_rows == 0 OR $this->per_page == 0) { return ''; } // Calculate the total number of pages $num_pages = ceil($this->total_rows / ...
分类:
其他好文 时间:
2014-08-28 18:03:15
阅读次数:
354
【题意简述】:给出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