SHARE
TWEET

Untitled

a guest Feb 21st, 2020 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <string>
  3. #include <vector>
  4. #include <iostream>
  5. #include <fstream>
  6. #include <algorithm>
  7. #include <set>
  8. #include <map>
  9. #include <unordered_set>
  10. #include <unordered_map>
  11. #include <list>
  12. #include <deque>
  13. #include <memory>
  14. #include <utility>
  15. #include <queue>
  16. #include <math.h>
  17. #include <ctime>
  18. #include <random>
  19. #include <functional>
  20.  
  21. using namespace std;
  22.  
  23. int main() {
  24.     ios_base::sync_with_stdio(0);
  25.     cin.tie(0);
  26.     int n;
  27.     cin >> n;
  28.     int i = 1;
  29.     while (n >= i) {
  30.         n -= i;
  31.         i++;
  32.     }
  33.  
  34.     cout << i - 1;
  35.  
  36.     return 0;
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top