上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 27 下一页
摘要: 这个题要用到欧拉函数;a1^p1*a2^p2*a3^p3……an^pn,那么他的因子就有(p1 +1)*(p2+1)*……*(pn+1);View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#include<map>#include<cstring>#include<vector>us 阅读全文
posted @ 2012-07-15 08:42 wutaoKeen 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 这是一个找规律的题;例如: 12互质的数有 1 5 7 11 (12)13 17 19 22 (24) 25我们可以看到一个循环节;View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#include<map>#include<cstring>#include<vector>using 阅读全文
posted @ 2012-07-14 19:44 wutaoKeen 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Perfect Pth PowersTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 14097Accepted: 3192DescriptionWe say that x is a perfect square if, for some integer b, x = b2. Similarly, x is a perfect cube if, for some integer b, x = b3. More generally, x is a perfect pth power if, for some integer b, x 阅读全文
posted @ 2012-07-14 16:38 wutaoKeen 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 这个其实比较水,只是用到了一个同余定理,还有一个素数二重筛选;View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#include<map>#include<cstring>#include<vector>using namespace std;int prime[10000],cnt 阅读全文
posted @ 2012-07-14 14:20 wutaoKeen 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 素数水题:View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#include<map>#include<cstring>#include<vector>using namespace std;int prime[10000],cnt=0;bool hash[100024];void 阅读全文
posted @ 2012-07-14 11:06 wutaoKeen 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题意:给定你一个数n,让你求出1-n内有多少个素数,再给你一个数d,如果2*d大于素数的个数则全部输出;否则,如果个数为单数,输出2*d - 1个并且以中间那个素数为中心分别向两边输出d-1个;如果偶数个,输出2*d个,也是以中间那个素数为中心向两边扩展;View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#includ 阅读全文
posted @ 2012-07-14 11:05 wutaoKeen 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 一道素数与BFS结合的题;View Code View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#include<map>#include<cstring>#include<vector>using namespace std;class que{public: int num; i 阅读全文
posted @ 2012-07-14 10:06 wutaoKeen 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 素数水题:View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#include<map>#include<cstring>#include<vector>using namespace std;int prime[100000],cnt=0;bool hash[700024];void 阅读全文
posted @ 2012-07-14 08:58 wutaoKeen 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 一道简单的素数题:View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<queue>#include<set>#include<map>#include<cstring>#include<vector>using namespace std;int prime[100000],cnt=0;bool hash[1000024] 阅读全文
posted @ 2012-07-14 08:46 wutaoKeen 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 求一个数能够被连续的素数的和组成有几种方法:直接用暴力;View Code #include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<cstring>using namespace std;int prime[2024],cnt,sum;void Prime( ){ bool hash[5024] = { 0 }; int t = ( int )sqrt( 10000.0 ) + 1; for( 阅读全文
posted @ 2012-07-13 22:51 wutaoKeen 阅读(132) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 27 下一页