murugappan_s

VKURI Solution

Oct 14th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define ll long long
  3. #define ld long double
  4. #define pb push_back
  5. #define x first
  6. #define y second
  7. #define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  8. #define PI (atan(1)*4)
  9. #define mp make_pair
  10. using namespace std;
  11.  
  12. int main()
  13. {
  14.     fastread;
  15.     ll n;
  16.     cin >> n;
  17.     cout << (long long)((sqrt(1 + 8 * n) - 1) / 2);
  18.     return 0;
  19. }
Add Comment
Please, Sign In to add comment