码迷,mamicode.com
首页 >  
搜索关键字:prime    ( 2475个结果
JD 题目1040:Prime Number (筛法求素数)
OJ题目:click here~~ 题目分析:输出第k个素数 贴这么简单的题目,目的不清纯 用筛法求素数的基本思想是:把从1開始的、某一范围内的正整数从小到大顺序排列, 1不是素数,首先把它筛掉。剩下的数中选择最小的数是素数,然后去掉它的倍数。依次类推。直到筛子为空时结束。如有: 1 2 3 4 5 ...
分类:其他好文   时间:2017-08-15 22:55:01    阅读次数:133
C++primer 10.4.2节练习
练习10.29 练习10.30 练习10.31 练习10.32 自己写的程序有错,需要修改,稍后上传 练习10.33 ...
分类:编程语言   时间:2017-08-14 22:26:44    阅读次数:192
poj2109
Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area h ...
分类:其他好文   时间:2017-08-14 17:22:28    阅读次数:135
C++primer 10.3.3节练习
练习10.20 练习10.21 ...
分类:编程语言   时间:2017-08-14 16:27:05    阅读次数:163
分解质因数 样例代码
1 #include 2 #include 3 #include 4 const int MAXN = 1000; 5 6 int num[MAXN n) break; 20 bp[i*prime[j]] = true; 21 if(i%prime[j] == 0) break; 22 } 23 .... ...
分类:其他好文   时间:2017-08-13 20:50:07    阅读次数:161
C++primer 10.2.1节练习
练习10.3 练习10.4 最后返回的值精度会丢失,但编译器不会提示有错误,因为accumulate的第三个参数的类型决定了函数中使用哪个加法运算符一级返回值的类型; 练习10.5 如果写成 char * 会发出警告,表示字符串可以修改,而例子中的字符串不允许修改,更好的方法是写成const cha ...
分类:编程语言   时间:2017-08-12 17:08:45    阅读次数:148
C++primer 10.1节练习
练习10.1 练习10.2 ...
分类:编程语言   时间:2017-08-12 15:27:02    阅读次数:231
【模板】一坨数学算法
求GCD 线性筛求[1,n]的质数 1 bool isprime[1000]; 2 int prime[100],tot; 3 void pri(int n) 4 { 5 tot = 0; 6 memset(isprime,true,sizeof(isprime)); 7 int i,j; 8 fo ...
分类:编程语言   时间:2017-08-10 10:27:37    阅读次数:197
HDU 1010 Prime Ring Problem
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 adjacen ...
分类:其他好文   时间:2017-08-10 01:15:37    阅读次数:127
C++primer 9.2.4节练习
练习9.11 练习9.12 接受两个迭代器的拷贝构造函数可以将一个容器内的子序列进行拷贝,而接收一个容器创建其拷贝的构造函数拷贝的是整个容器所有的元素。 而且为了创建一个容器为另外一个容器的拷贝,两个容器的类型及其元素类型必须匹配,当传递迭代器参数来拷贝一个范围时,就不要求容器类型是相同的了,新容器 ...
分类:编程语言   时间:2017-08-09 21:22:36    阅读次数:188
2475条   上一页 1 ... 88 89 90 91 92 ... 248 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!