結果

問題 No.9 モンスターのレベル上げ
ユーザー chocorusk
提出日時 2020-09-07 14:00:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,275 ms / 5,000 ms
コード長 353 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 82,168 KB
実行使用メモリ 93,428 KB
最終ジャッジ日時 2024-11-29 10:41:33
合計ジャッジ時間 13,575 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
b=b+b
import heapq
ans=n
for i in range(n):
    que=[(x, 0) for x in a]
    heapq.heapify(que)
    for x in b[i:i+n]:
        p=que[0]
        heapq.heappushpop(que, (p[0]+x//2, p[1]+1))
    mx=0
    for p in que:
        mx=max(mx, p[1])
    ans=min(ans, mx)
print(ans)
0