結果
問題 | No.648 お や す み |
ユーザー |
|
提出日時 | 2019-10-06 15:22:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 245 bytes |
コンパイル時間 | 1,855 ms |
コンパイル使用メモリ | 167,092 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-10 02:59:12 |
合計ジャッジ時間 | 3,867 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 84 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {unsigned long long n;cin>>n;long long x = sqrt(1 + 8 * n);if (x * x != 1 + 8 * n) {cout<<"NO"<<endl;return 0;}cout<<"YES"<<endl;cout<<(-1 + x) / 2<<endl;}