結果

問題 No.9 モンスターのレベル上げ
ユーザー zimpha
提出日時 2017-12-07 01:21:58
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-11-29 01:42:29
合計ジャッジ時間 45,576 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 14 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

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