0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

CF47A Triangular numbers

R39546073
This commit is contained in:
Baoshuo Ren 2020-10-08 20:33:40 +08:00 committed by Baoshuo Ren
parent c527b6d924
commit dae34e06c0
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68
2 changed files with 21 additions and 1 deletions

View File

@ -70,6 +70,9 @@
"streambuf": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp"
"typeinfo": "cpp",
"any": "cpp",
"bit": "cpp",
"variant": "cpp"
}
}

17
problem/CF47A/CF47A.cpp Normal file
View File

@ -0,0 +1,17 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if ((i + 1) * i * 0.5 == n) {
cout << "YES" << endl;
goto end;
}
}
cout << "NO" << endl;
end:;
return 0;
}