码迷,mamicode.com
首页 >  
搜索关键字:c++ prime    ( 2475个结果
projecteuler---->problem=7----10001st prime
title: By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime number? 翻译: 通过列出前6个质数,我们可知第6个质数是13。 那么第10001个质数是...
分类:其他好文   时间:2014-06-05 12:28:28    阅读次数:277
hdu 1016 Prime Ring Problem (dfs)
一切见注释。 #include #include #include #include using namespace std; bool vis[22]; int n; int ans[22]; int top; bool isprime(int x)//判断素数 { for(int i=2;i<x;i++) if(x%i==0)return false; ...
分类:其他好文   时间:2014-06-05 08:26:47    阅读次数:201
JD 题目1040:Prime Number (筛法求素数)
OJ题目:click here~~ 题目分析:输出第k个素数 贴这么简单的题目,目的不纯洁 用筛法求素数的基本思想是:把从1开始的、某一范围内的正整数从小到大顺序排列, 1不是素数,首先把它筛掉。剩下的数中选择最小的数是素数,然后去掉它的倍数。依次类推,直到筛子为空时结束。如有: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15...
分类:其他好文   时间:2014-06-03 01:31:03    阅读次数:233
CodeForces 432C Prime Swaps
DescriptionYou have an arraya[1],?a[2],?...,?a[n], containing distinct integers from1ton. Your task is to sort this array in increasing order with the...
分类:其他好文   时间:2014-05-31 01:35:23    阅读次数:318
素数筛
这是我目前知道的打素数表最快的方法了………… 差不多是O(n)的,100000以内花了0.005秒。 1 int prime[100005], np, vis[100005]; 2 3 void get_prime(int n){ 4 mset(prime); mset(vis); 5 ...
分类:其他好文   时间:2014-05-30 23:26:36    阅读次数:204
欧拉项目007:第10001个素数
10001st prime Problem 7 By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime number? 使用埃拉托斯特尼筛法,不懂得自行Wiki 我的py...
分类:其他好文   时间:2014-05-26 05:35:25    阅读次数:248
hdu2136Largest prime factor (关建在求素数,有点意思的题)
Problem Description Everybody knows any number can be combined by the prime number. Now, your task is telling me what position of the largest prime factor. The position of prime 2 is 1, prime 3 is ...
分类:其他好文   时间:2014-05-26 04:29:14    阅读次数:371
uva10780Again Prime? No Time.
质因数分解。 1 //Accepted 0 KB 12 ms 2 #include 3 #include 4 #include 5 const int MAXN = 100005; 6 const int inf = 100000000; 7 int pri[MAXN]; 8 in...
分类:其他好文   时间:2014-05-25 23:10:33    阅读次数:283
Prime Ring Problem
Prime Ring ProblemTime Limit : 4000/2000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 27Accepted Submission(s) : 10Font...
分类:其他好文   时间:2014-05-25 19:47:04    阅读次数:228
2014辽宁ACM省赛 Prime Factors
问题 L: Prime Factors 时间限制: 1 Sec  内存限制: 128 MB 提交: 36  解决: 28 [提交][状态][论坛] 题目描述 I'll give you a number , please tell me how many different prime factors in this number. 输入 There is multiple te...
分类:其他好文   时间:2014-05-24 20:52:54    阅读次数:311
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!