Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <string>
- #include <iomanip>
- #include <cmath>
- #include <set>
- #include <map>
- using namespace std;
- const double pi = 3.141592653589793238;
- const double eps = 1e-10;
- const int inf = 1000000007;
- int main()
- {
- ios::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- int n;
- cin >> n;
- set<long long> m;
- m.insert(1);
- for (auto it = m.begin(); it != m.end(); ++it)
- {
- long long el = *it;
- if (el >= static_cast<long long>(1e18) / 2)
- continue;
- m.insert(el * 2);
- m.insert(el * 3);
- m.insert(el * 5);
- it = m.find(el);
- }
- for (auto el : m)
- {
- --n;
- if (n == 0)
- cout << el << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement