結果
問題 |
No.648 お や す み
|
ユーザー |
![]() |
提出日時 | 2018-02-24 01:19:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 559 bytes |
コンパイル時間 | 703 ms |
コンパイル使用メモリ | 82,856 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 21:13:12 |
合計ジャッジ時間 | 2,561 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 84 |
ソースコード
#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; cout << s << endl; } else cout << "NO" << endl; }