結果
問題 |
No.648 お や す み
|
ユーザー |
![]() |
提出日時 | 2018-05-11 21:16:25 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 357 bytes |
コンパイル時間 | 233 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-28 04:01:09 |
合計ジャッジ時間 | 4,541 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 82 WA * 2 |
ソースコード
import math n = float(input()) t = (1 + math.sqrt(1 + 8 * n)) / 2 case_1 = int(t) - 1 case_2 = int(t) case_3 = int(t) + 1 if case_1 * (case_1 + 1) / 2 == n: print("YES") print(case_1) elif case_2 * (case_2 + 1) / 2 == n: print("YES") print(case_2) elif case_3 * (case_3 + 1) / 2 == n: print("YES") print(case_3) else: print("NO")