Uva 11752 The Super Powers
来源:互联网 发布:淘宝买的ios付费游戏 编辑:程序博客网 时间:2024/05/17 01:04
#include <iostream>#include <cstdio>#include <cstring>#include <set>#include <cmath>using namespace std;#define ULL unsigned long long#define del(a,b) memset(a,b,sizeof(a))int p[65];bool isp(int x){for(int i=2;i*i<=x;i++){if(x%i==0) return false;}return true;}void init(){del(p,0);for(int i=4;i<=64;i++){if(isp(i)) p[i]=1;}}int main(){init();ULL MAXN,X,Y;MAXN=(ULL)(2<<63);MAXN=MAXN-1+MAXN;set<ULL> V;V.insert(1);for(int i=2;i<(2<<16);i++){X=log(MAXN)/log(i);for(int j=4;j<=X;j++){if(!p[j]){Y=1;for(int k=1;k<=j;k++)Y*=i;V.insert(Y);}}}set<ULL>::iterator it;/*cout<<V.size()<<"\n";it=V.begin();cout<<*it<<"\n";it++;cout<<*it<<"\n";it++;cout<<*it<<"\n";it++;cout<<*it<<"\n";it++;cout<<*it<<"\n";it++;cout<<*it<<"\n";it++;cout<<*it<<"\n";*/it=V.begin();it++;for(it;it!=V.end();it++) cout<<*it<<"\n";}
0 0
- UVA - 11752 The Super Powers
- UVA 11752-The Super Powers
- Uva 11752 The Super Powers
- UVA 11752 The Super Powers
- uva 11752The Super Powers
- UVA 11752 The Super Powers
- uva 11752 The Super Powers
- UVA 11752 The Super Powers
- The Super Powers UVA
- The Super Powers UVA
- The Super Powers UVA
- UVa 11752 The Super Powers (数学)
- UVA 11752 - The Super Powers (数论)
- UVa 11752 - The Super Powers (数论)
- UVa 11752 The Super Powers(数学)
- UVA 11752 The Super Powers 超级幂
- uva 11752 -The Super Powers (数论)
- UVA 11752 The Super Powers【超级幂】
- 关于内存中栈和堆的区别[转]
- Uvalive 6855 Banks
- 基于libevent的多线程通信框架实现
- win7下cocos2dx开发环境搭建
- 杭电 HDU OJ Max Sum ID1003 AC
- Uva 11752 The Super Powers
- LeetCode 279 PerfectSquares
- 黑马程序员——学习日记1
- android:allowBackup=true 数据备份(adb backup)+查看(abe unpack backup.ab backup.tar)+恢复(adb re)
- openfire中开发带servlet的插件并实现免认证访问
- ListView中带有CheckBox时,解决CheckBox重复选择问题的一个不错方案
- 从“造”论文到自然而然写论文
- fgets()读取一行数据
- 第二周项目(4):体验复杂度