結果
問題 |
No.648 お や す み
|
ユーザー |
![]() |
提出日時 | 2018-02-24 01:16:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 517 bytes |
コンパイル時間 | 791 ms |
コンパイル使用メモリ | 83,856 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-10 20:14:38 |
合計ジャッジ時間 | 3,155 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 53 WA * 31 |
ソースコード
#include <iostream> #include <iomanip> #include <cstring> #include <algorithm> #include <math.h> #include <queue> #include <functional> #include <map> #include <vector> #include <string> using namespace std; typedef long long ll; typedef pair<int, int> P; int dx[] = { 1, 0, -1, 0 }; int dy[] = { 0, 1, 0, -1 }; const ll MOD = 1000000007; const ll INF = 100000; ll n; int main(void){ cin >> n; ll s = (ll)sqrt(2 * n); if (s*(s + 1) == 2 * n) cout << "YES" << endl; else cout << "NO" << endl; }