結果

問題 No.9 モンスターのレベル上げ
ユーザー convexineqconvexineq
提出日時 2020-12-13 09:48:11
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 1,466 ms / 5,000 ms
コード長 368 bytes
コンパイル時間 265 ms
使用メモリ 93,948 KB
最終ジャッジ日時 2022-11-18 17:45:51
合計ジャッジ時間 16,328 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 90 ms
75,764 KB
testcase_01 AC 89 ms
75,860 KB
testcase_02 AC 1,463 ms
93,356 KB
testcase_03 AC 1,230 ms
91,260 KB
testcase_04 AC 747 ms
86,628 KB
testcase_05 AC 580 ms
85,780 KB
testcase_06 AC 332 ms
83,328 KB
testcase_07 AC 153 ms
82,820 KB
testcase_08 AC 382 ms
84,124 KB
testcase_09 AC 1,440 ms
93,472 KB
testcase_10 AC 89 ms
75,488 KB
testcase_11 AC 1,053 ms
90,056 KB
testcase_12 AC 1,027 ms
84,900 KB
testcase_13 AC 953 ms
89,216 KB
testcase_14 AC 1,466 ms
93,948 KB
testcase_15 AC 1,321 ms
92,052 KB
testcase_16 AC 195 ms
83,368 KB
testcase_17 AC 926 ms
88,196 KB
testcase_18 AC 822 ms
87,660 KB
testcase_19 AC 169 ms
82,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = [(int(i),0) for i in input().split()]
*b, = map(int,input().split())
for i in range(n):
    b[i] //= 2
b += b

from heapq import *
ans = 1<<30
for i in range(n):
    q = a[:]
    heapify(q)
    for j in range(i,i+n):
        v,t = heappop(q)
        heappush(q,(v+b[j],t+1))
    x = max(t for v,t in q)
    if x < ans:
        ans = x
print(ans)
0