码迷,mamicode.com
首页 >  
搜索关键字:prime    ( 2475个结果
HDU 4135
状态压缩其实刚开始没看懂为什么要用位运算后来看了别人的注释逐渐明白我也加上注释吧 1 #include 2 using namespace std; 3 4 long long Prime[50];//存放N的质因子 5 6 7 long long getNonCoPrime(long lo...
分类:其他好文   时间:2014-07-22 00:05:36    阅读次数:226
求一个数的质因子
private static void prime(int i){ int j = 2; while(true){ while(i%j == 0 && i != j){ System.out.println("Prime num " + j); i = i/j; } if(i == j){ ...
分类:其他好文   时间:2014-07-21 23:30:20    阅读次数:426
POJ 2739 Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Description Some positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive ...
分类:其他好文   时间:2014-07-21 22:18:12    阅读次数:222
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
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
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!