码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
Winter-1-C A + B II 解题报告及测试数据
Time Limit:1000MSMemory Limit:32768KBDescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of ...
分类:Windows程序   时间:2015-02-24 00:45:39    阅读次数:344
UVa 11105 (筛法) Semi-prime H-numbers
题意:你现在来到了一个所有的数都模4余1的世界,也就是除了这种数没有其他的数了。然而素数的定义依然没变,如果一个数不能写成两个非1数字的乘积,则它是素数。比如,在这里5就变成了最小的素数。两个素数相乘得到一个半素数,比如5×5 = 25就是最小的半素数。求1~h之间有多少个半素数。分析:虽然是要求[...
分类:其他好文   时间:2015-02-23 22:28:12    阅读次数:190
1001. A+B Format (20)
Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Each input file cont...
分类:其他好文   时间:2015-02-23 14:20:06    阅读次数:146
【SICP练习】69 练习2.40
?? 练习2.40 这道题要我们写一个传入一个整数n然后返回一个序对(i, j)的过程unique-pairs,然后用于上一页的prime-sum-pairs的定义。此时我们要注意在prime-sum-pairs中哪一段代码表达的是这个意思。没错,是flatmap函数。因此我们将其写入到unique-pairs中。 (define (unique-pairs n)    (...
分类:其他好文   时间:2015-02-23 09:45:37    阅读次数:155
HDOJ 1164 Eddy's research I
【题意】:对一个数进行因式分解。 【思路】:打表后一个一个除,最大数是65535,所以10000的质数范围苟用。 【AC代码】: #include #include #include #include #include #include using namespace std; #define MAX 10000 int cnt; int prime_list[MAX]; ...
分类:其他好文   时间:2015-02-23 09:42:40    阅读次数:173
Gambler's Ruin Problem and 3 Solutions
In my stochastic processes class, Prof Mike Steele assigned a homework problem to calculate the ruin probabilities for playing a game where you with $...
分类:其他好文   时间:2015-02-23 09:36:56    阅读次数:382
poj 3641 Pseudoprime numbers
Pseudoprime numbersTime Limit:1000MSMemory Limit:65536KTotal Submissions:7000Accepted:2855DescriptionFermat's theorem states that for any prime number...
分类:其他好文   时间:2015-02-23 09:35:42    阅读次数:204
poj 1595 Prime Cuts
Prime CutsTime Limit:1000MSMemory Limit:10000KTotal Submissions:10610Accepted:4046DescriptionA prime number is a counting number (1, 2, 3, ...) that i...
分类:其他好文   时间:2015-02-23 08:33:33    阅读次数:175
poj 3518 Prime Gap
Prime Gap 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define max 10000010 int prime[max+5];...
分类:其他好文   时间:2015-02-22 23:01:37    阅读次数:195
AOJ 0009 Prime Number(求素数)
题意:给定一个数n,判断从2—n中的素数个数是多少。KEY:这里有两种做法,一是没注释那个代码测试极端数据999999就会错的,二是注释掉的那段代码才能AC。对于一眼看上去很简单的题目,特别要注意时间复杂度。#include #include #include const int maxn = 99...
分类:其他好文   时间:2015-02-22 14:33:50    阅读次数:148
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!