結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
![]() |
提出日時 | 2017-12-19 11:59:19 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 4,896 ms / 5,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-06-24 00:21:32 |
合計ジャッジ時間 | 20,510 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import heapq n = int(input()) a_ls = [int(a) for a in input().split()] b_ls = [int(b) for b in input().split()] hq_o = [(a, 0) for a in a_ls] heapq.heapify(hq_o) ct_max_min = float('inf') for i in range(n): hq = hq_o[:] ct_max = 0 for j in range(n): lv, ct = hq[0] lv += b_ls[(i + j) % n] // 2 ct += 1 heapq.heapreplace(hq, (lv, ct)) ct_max = max(ct, ct_max) if ct_max >= ct_max_min: break ct_max_min = min(ct_max_min, ct_max) print(ct_max_min)