結果

問題 No.9 モンスターのレベル上げ
ユーザー ゆるく
提出日時 2014-10-10 01:14:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 513 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 23,168 KB
最終ジャッジ日時 2024-12-30 08:24:45
合計ジャッジ時間 68,361 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 TLE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
from collections import deque
from copy import deepcopy
d = deque()
n = int(input())

a = []

for i in (input().split()):
    heapq.heappush(a,[int(i),0])
b = deque(list(map(int, input().split())))
c = n
ans = 0xFFFFFFFF
while (c):
    tmp = deepcopy(a)
    mx = 0
    for bb in b:
        t = heapq.heappop(tmp)
        t[0] += bb // 2
        t[1] += 1
        heapq.heappush(tmp, t)
        mx = max(mx, t[1])
    c -= 1
    ans = min(ans, mx)
    b.rotate(1)
print(ans)
0