FEgor04

Untitled

Aug 14th, 2019
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #pragma GCC target ("avx2")
  5. #pragma GCC optimization ("O3")
  6. #pragma GCC optimization ("unroll-loops")
  7.  
  8. int main() {
  9.     ios_base::sync_with_stdio(0);
  10.     cin.tie(NULL);
  11.     cout.tie(NULL);
  12.     // freopen("input.txt", "r", stdin);
  13.     long long n, answer;
  14.     answer = 0;
  15.     cin >> n;
  16.     for(long long i = 1; n >= 0; i++) {
  17.         n -= i;
  18.         answer++;
  19.     }
  20.     cout << answer - 1;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment