結果

問題 No.9 モンスターのレベル上げ
ユーザー kohei2019
提出日時 2021-02-03 09:00:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,031 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 90,920 KB
最終ジャッジ日時 2024-06-30 00:12:56
合計ジャッジ時間 20,394 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())
lsA = list(map(int,input().split()))
lsB = list(map(int,input().split()))
#N**2logN
ans = float('INF')
for st in range(N):
    h = [(i,0) for i in lsA]
    heapq.heapify(h)
    for i in range(N):
        lv,times = heapq.heappop(h)
        lv += lsB[(st+i)%N]//2
        heapq.heappush(h,(lv,times+1))
    cnt = 0
    for i in range(N):
        lv,times = heapq.heappop(h)
        cnt = max(cnt,times)
    ans = min(cnt,ans)
print(ans)
0