結果

問題 No.648  お や す み 
ユーザー lam6er
提出日時 2025-03-20 21:06:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,480 KB
実行使用メモリ 53,820 KB
最終ジャッジ日時 2025-03-20 21:06:49
合計ジャッジ時間 5,099 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 84
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())
x = 8 * n + 1

s = math.isqrt(x)
if s * s == x:
    if s % 2 == 1:
        i = (s - 1) // 2
        print("YES")
        print(i)
    else:
        print("NO")
else:
    print("NO")
0