码迷,mamicode.com
首页 >  
搜索关键字:bear and prime numbe    ( 2904个结果
POJ 3292 Semi-prime H-numbers
Semi-prime H-numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7372 Accepted: 3158 Description This problem is based on an exercise of David Hilbert, who pedagogically s...
分类:其他好文   时间:2014-07-21 11:13:15    阅读次数:269
hdu 1016 Prime Ring Problem (简单DFS)
Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25700Accepted Submission(s): 114...
分类:其他好文   时间:2014-07-19 22:23:15    阅读次数:211
素数打表
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxn = 1e6; 8 bitset prime; 9 10 void init()11 {12 int ...
分类:其他好文   时间:2014-07-18 13:31:49    阅读次数:261
BNU 25593 Prime Time 记忆化dp
题目链接:点击打开链接 题意: 一个游戏由3个人轮流玩 每局游戏由其中一名玩家选择一个数字作为开始 目的:获得最小的得分 对于当前玩家 O ,面对 u 这个数字 则他的操作有: 1、 计分 u +1 ,然后 u++; 2、计分 u / x, 然后 u /= x; 其中x为u的因子且x为素数 然后下一个玩家继续上述操作 3个人各操作一次 为1轮 当一轮结束后,若u==1 则游戏...
分类:其他好文   时间:2014-07-18 13:28:50    阅读次数:200
POJ - 3126 Prime Path
BFS,最好先打个质数表。 1 #include 2 #include 3 #include 4 #include 5 //#include 6 const int maxn=15000+5; 7 int s[10]; 8 int vis[maxn],isp[maxn]; 9 us...
分类:其他好文   时间:2014-07-18 09:29:37    阅读次数:231
字符与字符串
字符:Swift中的字符串不是指针,而是实际的值用Character定义一个字符countElements(字符串)//计算字符个数循环//如果不需要知道区间内每一项的值,可以使用 _ 来代替变量名忽略对该值的访问for _ in 1...power{ answer*=base}let numbe....
分类:其他好文   时间:2014-07-18 08:26:55    阅读次数:188
CodeForces114E——Double Happiness(素数二次筛选)
Double HappinessOn the math lesson a teacher asked each pupil to come up with his own lucky numbers. As a fan of number theory Peter chose prime numbe...
分类:移动开发   时间:2014-07-18 00:12:12    阅读次数:616
UVA 10168 Summation of Four Primes(数论)
Summation of Four Primes Input: standard input Output: standard output Time Limit: 4 seconds Euler proved in one of his classic theorems that prime numbers are infinite in number. But can every nu...
分类:其他好文   时间:2014-07-17 21:05:16    阅读次数:299
POJ 2739 Sum of Consecutive Prime Numbers
?? Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18782   Accepted: 10308 Description Some positive integers can be represen...
分类:其他好文   时间:2014-07-17 19:15:16    阅读次数:260
UVA 11762 - Race to 1(概率)
UVA 11762 - Race to 1 题意:给定一个n,每次随即选择一个n以内的质数,如果不是质因子,就保持不变,如果是的话,就把n除掉该因子,问n变成1的次数的期望值 思路:tot为总的质数,cnt为质因子个数,那么f(n)=(1?cnt/tot)?f(n)+∑f(n/prime)?(1/tot),然后利用记忆化搜索去做即可 代码: #include #inclu...
分类:其他好文   时间:2014-07-17 15:36:46    阅读次数:211
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!