結果

問題 No.648  お や す み 
ユーザー Mcpu3
提出日時 2018-09-22 16:00:31
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 247 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-18 08:59:19
合計ジャッジ時間 1,967 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 79 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main(void)
{
    long n,t;
    scanf("%ld",&n);
    t=((long)sqrt(1+8*n)-1)/2;
    if(n==(t*(t+1))/2){
        puts("YES");
        printf("%ld",t);
    }
    else puts("NO");
    return 0;
}
0