結果

問題 No.648  お や す み 
ユーザー Pachicobue
提出日時 2018-02-11 18:50:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 773 ms
コンパイル使用メモリ 77,912 KB
最終ジャッジ日時 2025-01-05 08:19:48
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 84
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
using ll = long long;
int main()
{
ll N;cin >>N;
const ll m = sqrt(2*N);
if(m*(m+1)/2 == N){
cout << "YES"<<endl;
cout << m << endl;
} else {
cout << "NO"<<endl;
}
return 0;
}
0