結果

問題 No.9 モンスターのレベル上げ
ユーザー Navier_Boltzmann
提出日時 2022-10-10 09:05:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 82,500 KB
実行使用メモリ 85,556 KB
最終ジャッジ日時 2024-06-24 04:43:47
合計ジャッジ時間 12,301 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline


N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
A += A
Y = [(b,0) for b in B]
heapify(Y)
ans = N
for i in range(N):
    
    h = Y[:]
    tans = 0
    for j in range(N):
        
        a = A[i+j]
        x,c = heappop(h)
        x += a//2
        c += 1
        tans = max(tans,c)
        heappush(h,(x,c))
    ans = min(ans,tans)
print(ans)
0