12345678910111213141516171819202122232425262728293031 |
- #include <bits/stdc++.h>
-
- using namespace std;
- int m;
-
- bool Find(int x) {
- if (x * (x + 1) == m) {
- return true;
- }
- return false;
- }
-
- int main() {
- int n;
- while (cin >> n) {
- m = n <<= 1;
- bool flag = false;
- for (int i = 1; i < sqrt(m); i++) {
- if (Find(i)) {
- flag = true;
- break;
- }
- }
- if (flag) {
- cout << "YES" << endl;
- } else {
- cout << "NO" << endl;
- }
- }
- return 0;
- }
|