mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 21:48:48 +00:00
CF47A Triangular numbers
R39546073
This commit is contained in:
parent
c527b6d924
commit
dae34e06c0
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -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
17
problem/CF47A/CF47A.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user