結果

問題 No.648  お や す み 
コンテスト
ユーザー cologne
提出日時 2025-12-02 16:06:34
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 66 ms / 2,000 ms
+ 380µs
コード長 294 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 249 ms
コンパイル使用メモリ 96,104 KB
実行使用メモリ 79,104 KB
最終ジャッジ日時 2026-07-17 06:04:51
合計ジャッジ時間 8,967 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 84
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
from math import isqrt


def input(): return sys.stdin.readline().rstrip('\n')


def main():
    n = int(input())
    k = isqrt(8 * n + 1) // 2

    if k * (k + 1) // 2 != n:
        print('NO')
    else:
        print('YES')
        print(k)


if __name__ == '__main__':
    main()
0