fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long S;
  6. int n=0;
  7.  
  8. cin>>S;
  9.  
  10. while(S>0){
  11. n++;
  12. S-=n;
  13. }
  14.  
  15. if(S<0)
  16. n--;
  17.  
  18. cout<<n;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 5316KB
stdin
200
stdout
19