結果

問題 No.9 モンスターのレベル上げ
ユーザー nsd_fbnsd_fb
提出日時 2015-02-19 04:55:21
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 6,524 KB
実行使用メモリ 10,616 KB
最終ジャッジ日時 2023-09-06 02:22:03
合計ジャッジ時間 30,832 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 OLE -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 OLE -
testcase_10 WA -
testcase_11 OLE -
testcase_12 OLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq

n = input()
a = map(int, raw_input().split())
b = map(int, raw_input().split())

init = []
for level in a:
    init.append((level, 0))

heapq.heapify(init)
ans = float("inf")

for offset in xrange(-n, 0):
    queue = list(init)

    print queue

    for i in xrange(offset, offset + n):
        level, battle = heapq.heappop(queue)
        heapq.heappush(queue, (level + b[i] // 2, battle + 1))

    max_battle = 0
    for level, battle in queue:
        max_battle = max(max_battle, battle)

    ans = min(ans, max_battle)

print ans
0