码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
[Leetcode] Count Primes
Description:Count the number of prime numbers less than a non-negative number,nHint:The number n could be in the order of 100,000 to 5,000,000.click t...
分类:其他好文   时间:2015-04-27 23:37:49    阅读次数:147
SDUT 1351 Max Sum
Max Sum Time Limit: 2000ms   Memory limit: 32768K  有疑问?点这里^_^ 题目描述 Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, ...
分类:其他好文   时间:2015-04-27 21:51:49    阅读次数:169
Count Primes
Description:Count the number of prime numbers less than a non-negative number,nHint:The number n could be in the order of 100,000 to 5,000,000.C++实现代码...
分类:其他好文   时间:2015-04-27 21:22:18    阅读次数:92
Leetcode Count Prime
Description:Count the number of prime numbers less than a non-negative number,nHint:The number n could be in the order of 100,000 to 5,000,000.#define...
分类:其他好文   时间:2015-04-27 19:46:35    阅读次数:100
leetcode - Count Primes
leetcode -https://leetcode.com/problems/count-primes/Q:Description:Count the number of prime numbers less than a non-negative number,nHint:The number ...
分类:其他好文   时间:2015-04-27 18:10:59    阅读次数:230
编程珠玑(续) 读书笔记 -(前言+第一章性能监视工具)
《ACM通讯》一次一章,仔细地读ANSIAmerican National Standards Institute 美国国家标准学会1.1计算素数#includeint prime(int n ){ int i; for(i =2;i#includeint root(int n ){ ...
分类:其他好文   时间:2015-04-27 12:53:41    阅读次数:129
1 UVA 10789 Prime Frequency
先筛素数,再统计给定字符的出现频率。 #include #include using namespace std; bool pri[2010]; char s[2010]; void init() { int i,j; memset(pri,1,sizeof pri); pri[0]=pri[1]=0; for(i=2;i<=2000;i++) ...
分类:其他好文   时间:2015-04-26 22:56:21    阅读次数:264
3 UVA 10852 Less Prime
先筛素数, 再枚举题目范围内质数,答案就是求最小的ans=n-n/i*i ,其中i是枚举的质数 #include #include #include using namespace std; bool pri[10010]; void init() { int i,j; memset(pri,1,sizeof pri); pri[0]=pri[1]=0;...
分类:其他好文   时间:2015-04-26 22:56:07    阅读次数:246
4 UVA 10924 Prime Words
筛素数,把给的单词中出现的字母对应值加起来,判断是否是质数。 #include #include using namespace std; const int maxn=2000; int pri[maxn+10]; char s[100]; void init() { int i,j; memset(pri,1,sizeof pri); pri[0]=0...
分类:其他好文   时间:2015-04-26 22:55:49    阅读次数:141
《软件测试技术》课程第七周随笔
软件测试第二次试验软件测试第二次试验为白盒测试,使用了单元测试1. 实验准备Windows 8.1,Visual Studio Ultimate 2013,被测试软件(Is it a prime number?)2. 实验步骤①使用Windows8.1系统,安装好Visual Studio Ulti...
分类:其他好文   时间:2015-04-26 17:58:43    阅读次数:155
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!