Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define ll long long
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- ll k;
- cin >> k;
- set<ll>s;
- s.insert(1);
- auto it=s.begin();
- while (s.size()<=1e4) {
- s.insert(*it *2);
- s.insert(*it *3);
- s.insert(*it *5);
- it++;
- }
- cout << *next(s.begin(),k-1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment