結果

問題 No.648  お や す み 
ユーザー Aquaplus
提出日時 2018-02-10 14:04:18
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 340 bytes
コンパイル時間 522 ms
コンパイル使用メモリ 67,200 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 09:45:21
合計ジャッジ時間 2,422 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 69 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;

int main(void)
{
    long double t;
    long double n;
    cin >> n;

    t = (sqrtl(1+8*n)-1)/2;

    long long  a = t;

    if((t - a) == 0)
        cout << "YES" <<endl << t <<endl;
    else
        cout << "NO" << endl;

    return 0;

}
0