結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
![]() |
提出日時 | 2017-12-19 13:17:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 4,019 ms / 5,000 ms |
コード長 | 569 bytes |
コンパイル時間 | 137 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-06-24 00:22:38 |
合計ジャッジ時間 | 15,914 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) db_ls = b_ls + b_ls ct_max_min = n for i in range(n): hq = hq_o[:] ct_max = 0 for b in db_ls[i:i + n]: lv, ct = hq[0] lv += b // 2 ct += 1 heapq.heapreplace(hq, (lv, ct)) if ct > ct_max: ct_max = ct if ct_max >= ct_max_min: break if ct_max < ct_max_min: ct_max_min = ct_max print(ct_max_min)