fork download
  1. #include <bits/stdc++.h>
  2. #define nmax 10000
  3. using namespace std;
  4. long long n,coun;
  5. void ip()
  6. {
  7. cin >> n;
  8. }
  9. void pc()
  10. {
  11. if (n!=1)
  12. {
  13. coun=1;
  14. while(n==n)
  15. {
  16. coun++;
  17. if ((coun*(coun-1))/2==n)
  18. {
  19. cout << "YES";
  20. break;
  21. }
  22. if ((coun*(coun-1))/2>n)
  23. {
  24. cout << "NO";
  25. break;
  26. }
  27. }
  28. }
  29. else cout << "YES";
  30. }
  31. int main()
  32. {
  33. ios_base::sync_with_stdio();
  34. ip();
  35. pc();
  36. return 0;
  37. }
Success #stdin #stdout 0.11s 2744KB
stdin
555555561111111
stdout
YES