結果

問題 No.9 モンスターのレベル上げ
ユーザー zimpha
提出日時 2017-12-07 01:22:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 94,628 KB
最終ジャッジ日時 2024-11-29 01:43:05
合計ジャッジ時間 14,368 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *

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

ret = 0
for i in range(n):
    pq = [(x, 0) for x in a]
    heapify(pq)
    for j in range(n):
        e = b[(i + j) % n]
        u = heappop(pq)
        u = (u[0] + e // 2, u[1] + 1)
        heappush(pq, u)
    for e in pq:
        ret = max(ret, e[1])
print(ret)
0