lina_os

Untitled

Mar 24th, 2025 (edited)
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 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. while (s.size()<=1e4) {
  14. s.insert(*it *2);
  15. s.insert(*it *3);
  16. s.insert(*it *5);
  17. it++;
  18. }
  19. cout << *next(s.begin(),k-1);
  20. return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment