結果

問題 No.9 モンスターのレベル上げ
ユーザー zer0
提出日時 2020-03-30 23:54:10
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 475 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 158,880 KB
最終ジャッジ日時 2024-06-23 07:20:28
合計ジャッジ時間 6,901 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
import copy
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ahq = []
for i in a:
    heapq.heappush(ahq, [i, 0])

ans = 10 ** 18
for i in range(N):
    tans = 0
    hq = copy.deepcopy(ahq)
    for j in range(i, N + i):
        l, c = heapq.heappop(hq)
        heapq.heappush(hq, [l + (b[j % N] // 2), c + 1])
    while hq:
        l, c = heapq.heappop(hq)
        tans = max(tans, c)
    ans = min(ans, tans)

print(tans)
0