UVa 11752 - The Super Powers 数学

时间:2021-06-22 04:12:04

请看这个说明http://blog.csdn.net/u014800748/article/details/45914353

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
bool vis[];
set<ULL>s;
int main()
{
int prime[] = { , , , , , , , , , , , , , , , , , };
for (int i = ; i < ; i++)
vis[prime[i]] = ;
ULL lim = ~0LL >> ;
s.clear();
for (ULL i = ;; ++i){
ULL cnt = -, x = lim;
while (x){
x /= i;
cnt++;
}
if (cnt < )break;
ULL b = i;
for (ULL j = ; j <= cnt; ++j){
b *= i;
if (!vis[j])
s.insert(b);
}
}
s.insert();
set<ULL>::iterator it;
for (it = s.begin(); it != s.end(); it++)
cout << *it << '\n';
return ;
}