結果

問題 No.648  お や す み 
ユーザー ああいい
提出日時 2021-12-06 19:15:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-07 09:30:32
合計ジャッジ時間 3,980 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 84
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
import sys

n = int(input())
D = 1 + 8 * n
if int(sqrt(D)) **2 == D:
    if (int(sqrt(D)) - 1) % 2 == 0:
        print('YES')
        print((int(sqrt(D))-1) // 2)
        exit()
print('NO')
0