結果

問題 No.648  お や す み 
コンテスト
ユーザー Ytz_Ichi
提出日時 2020-02-18 22:46:14
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 244 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 15,232 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2026-09-11 04:32:35
合計ジャッジ時間 5,338 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 83 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
import math

n = int(input())
drn = 1 + ((n - 1) % 9)

triangular = math.sqrt(8 * n + 1)
if triangular.is_integer() and (drn == 1 or drn == 3 or drn == 6 or drn == 9):
    print(f"YES\n{(int(triangular)-1)//2}")
else:
    print("NO")
0