fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. long long n,k;
  5. int main()
  6. {
  7. cin >> k;
  8. n=sqrt(2*k);
  9. if((n*(n+1)/2)==k) cout << "YES";
  10. else cout << "NO";
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 2744KB
stdin
555555561111111
stdout
YES