Advertisement
Egor_1425

Untitled

Jun 1st, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include<string>
  5. #include <cmath>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     uint64_t x;
  11.     cin >> x;
  12.     uint64_t i = 1, j = 1, a = 1, b = 1;
  13.     uint64_t res = 0;
  14.    
  15.     while (x)
  16.     {
  17.         if (a <= b)
  18.         {
  19.             x += a == b;
  20.             res = a;
  21.             i += 1;
  22.             a = i*i;
  23.         }
  24.         else
  25.         {
  26.             res = b;
  27.             j += 1;
  28.             b = j*j*j;
  29.         }
  30.         x -= 1;
  31.     }
  32.  
  33.     cout << res;
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement