#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <ctype.h>//isalpha,isdight,toupper
#include <map>
#include <sstream>
typedef long long ll;
using namespace std;
#define inf 0x3f3f3f3f
const int maxn=1010;
const int ugly[4]={2,3,5};
int main(){
priority_queue<ll,vector<ll>,greater<ll> >q;
set<ll>s;
q.push(1);
s.insert(1);
for(int i=1;;i++){
ll x=q.top();
q.pop();
if(i==1500){
cout<<x<<endl;
break;
}
for(int j=0;j<3;j++){
ll x2=x*ugly[j];
if(!s.count(x2)){
s.insert(x2);
q.push(x2);
}
}
}
return 0;
}
uva 136丑数
最新推荐文章于 2022-01-11 14:10:33 发布