码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
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
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 1012 u Calculate e
题解:直接模拟#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
POJ2318TOYS
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
绝对值函数abs、fabs等的使用
求数字的绝对值,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
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
spoj LCMSUM sigma(lcm(i,n));
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
codeigniter实现ajax分页
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
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!