結果

問題 No.648  お や す み 
ユーザー gemmarogemmaro
提出日時 2020-05-06 10:06:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 229 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-06-28 09:29:41
合計ジャッジ時間 4,951 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 53 WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

import math


def solve(x):
    r = math.sqrt(2 * x)
    for i in range(math.ceil(r) - 1, math.floor(r)):
        if i * (i + 1) == 2 * x:
            return "YES\n{}".format(i)
    return "NO"


n = int(input())

print(solve(n))
0