結果
| 問題 |
No.648 お や す み
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-12-27 20:40:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 46 ms / 2,000 ms |
| コード長 | 287 bytes |
| コンパイル時間 | 347 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-12-27 20:41:03 |
| 合計ジャッジ時間 | 5,414 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 84 |
ソースコード
import math
def check(x):
return x * (x + 1) // 2
n = int(input())
ng = 0
ok = pow(10, 18) * 2
while ng + 1 != ok:
mid = (ng + ok) // 2
if n <= check(mid):
ok = mid
else:
ng = mid
if check(ok) == n:
print("YES")
print(ok)
else:
print("NO")