結果

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

ソースコード

diff #

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

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