lina_os

Untitled

Mar 24th, 2025
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define ll long long
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  8. ll k;
  9. cin >> k;
  10. set<ll>s;
  11. s.insert(1);
  12. auto it=s.begin();
  13. int n=0;
  14. while (n<=k) {
  15. s.insert(*it *2);
  16. s.insert(*it *3);
  17. s.insert(*it *5);
  18. it++;
  19. n++;
  20. }
  21. cout << *next(s.begin(),k-1);
  22. return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment