結果

問題 No.9 モンスターのレベル上げ
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-10-10 09:05:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 88,748 KB
最終ジャッジ日時 2023-09-06 10:05:54
合計ジャッジ時間 14,469 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
72,784 KB
testcase_01 AC 112 ms
72,792 KB
testcase_02 AC 1,237 ms
88,192 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 307 ms
81,860 KB
testcase_07 AC 167 ms
79,696 KB
testcase_08 AC 344 ms
81,340 KB
testcase_09 AC 1,238 ms
88,600 KB
testcase_10 AC 114 ms
72,828 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 794 ms
84,624 KB
testcase_14 AC 1,202 ms
87,240 KB
testcase_15 AC 1,123 ms
86,936 KB
testcase_16 WA -
testcase_17 AC 787 ms
84,504 KB
testcase_18 AC 686 ms
82,916 KB
testcase_19 AC 187 ms
79,832 KB
権限があれば一括ダウンロードができます

ソースコード

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