結果

問題 No.9 モンスターのレベル上げ
ユーザー AEnAEn
提出日時 2022-12-15 01:32:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,435 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 83,072 KB
実行使用メモリ 92,580 KB
最終ジャッジ日時 2024-04-26 05:24:23
合計ジャッジ時間 15,209 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,096 KB
testcase_01 AC 42 ms
52,224 KB
testcase_02 AC 1,435 ms
92,580 KB
testcase_03 AC 1,185 ms
87,956 KB
testcase_04 AC 694 ms
81,288 KB
testcase_05 AC 483 ms
79,336 KB
testcase_06 AC 284 ms
77,760 KB
testcase_07 AC 104 ms
76,416 KB
testcase_08 AC 330 ms
77,944 KB
testcase_09 AC 1,351 ms
92,576 KB
testcase_10 AC 41 ms
52,608 KB
testcase_11 AC 1,133 ms
89,320 KB
testcase_12 AC 1,179 ms
89,220 KB
testcase_13 AC 846 ms
84,340 KB
testcase_14 AC 1,374 ms
92,212 KB
testcase_15 AC 1,317 ms
89,808 KB
testcase_16 AC 136 ms
76,576 KB
testcase_17 AC 913 ms
84,688 KB
testcase_18 AC 724 ms
82,504 KB
testcase_19 AC 134 ms
76,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappop, heappush

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

res = float('inf')
for i in range(N):
    h = []
    cnt = 0
    for j in range(N):
        heappush(h,(A[j],0))
    for j in range(N):
        b = B[(i+j)%N]
        lev, num = heappop(h)
        cnt = max(cnt,num+1)
        heappush(h,(lev+b//2,num+1))
    res = min(res, cnt)
print(res)

0