結果

問題 No.9 モンスターのレベル上げ
ユーザー mlihua09
提出日時 2020-09-01 17:41:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,179 ms / 5,000 ms
コード長 401 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 82,072 KB
実行使用メモリ 80,508 KB
最終ジャッジ日時 2024-11-19 14:31:36
合計ジャッジ時間 13,339 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())

A = list(map(lambda x: int(x) * 2000, input().split()))
B = list(map(int, input().split()))
ans = N
for i in range(-N + 1, 1):
    a = A.copy()
    heapq.heapify(a)
    x = 0
    for j in range(i, i + N):
        r = heapq.heappop(a)
        r += 1 + 2000 * (B[j] // 2)
        x = max(r % 2000, x)
        heapq.heappush(a, r)
        
    ans = min(ans, x)
print(ans)
0