結果
| 問題 |
No.9 モンスターのレベル上げ
|
| コンテスト | |
| ユーザー |
nisizawa
|
| 提出日時 | 2017-12-19 13:45:09 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 3,212 ms / 5,000 ms |
| コード長 | 435 bytes |
| コンパイル時間 | 312 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,264 KB |
| 最終ジャッジ日時 | 2024-06-24 00:23:45 |
| 合計ジャッジ時間 | 25,341 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / 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)
hb_ls = [b // 2 for b in b_ls]
hdb_ls = hb_ls + hb_ls
ans = n
for i in range(n):
hq = hq_o[:]
for hb in hdb_ls[i:i + n]:
lv, ct = hq[0]
heapq.heapreplace(hq, (lv + hb, ct + 1))
ans = min(ans, max([ct for lv, ct in hq]))
print(ans)
nisizawa