結果

問題 No.9 モンスターのレベル上げ
ユーザー AEnAEn
提出日時 2022-12-15 01:32:18
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 1,478 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 608 ms
使用メモリ 99,524 KB
最終ジャッジ日時 2022-12-15 01:32:37
合計ジャッジ時間 18,013 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 84 ms
75,764 KB
testcase_01 AC 85 ms
75,828 KB
testcase_02 AC 1,456 ms
99,524 KB
testcase_03 AC 1,238 ms
93,792 KB
testcase_04 AC 762 ms
87,700 KB
testcase_05 AC 552 ms
85,136 KB
testcase_06 AC 334 ms
83,728 KB
testcase_07 AC 149 ms
82,404 KB
testcase_08 AC 389 ms
83,524 KB
testcase_09 AC 1,467 ms
96,972 KB
testcase_10 AC 90 ms
75,756 KB
testcase_11 AC 1,181 ms
95,328 KB
testcase_12 AC 1,277 ms
94,560 KB
testcase_13 AC 862 ms
89,844 KB
testcase_14 AC 1,478 ms
98,024 KB
testcase_15 AC 1,364 ms
95,272 KB
testcase_16 AC 182 ms
82,356 KB
testcase_17 AC 984 ms
90,492 KB
testcase_18 AC 778 ms
88,504 KB
testcase_19 AC 185 ms
82,672 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