#include <iostream>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long LL;
const int coeff[3] = { 2, 3, 5 };
int main()
{
set<LL> dict;
priority_queue<LL> Q;
int result = 0;
Q.push(1);
dict.insert(1);
for (int i = 0; ; i++)
{
LL x;
x = Q.top();
Q.pop();
if (i == 1500)
cout << x<<endl;
for (int j = 0; j < 3; j++)
{
LL x2 = x*coeff[j];
if (!dict.count(x2))
{
dict.insert(x2);
Q.push(x2);
}
}
}
return 0;
}
程序没有问题,超时。。。还需要改进
306




被折叠的 条评论
为什么被折叠?



