結果

問題 No.9 モンスターのレベル上げ
ユーザー convexineqconvexineq
提出日時 2020-12-13 09:48:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,337 ms / 5,000 ms
コード長 368 bytes
コンパイル時間 1,219 ms
コンパイル使用メモリ 81,628 KB
実行使用メモリ 88,292 KB
最終ジャッジ日時 2023-10-20 03:37:38
合計ジャッジ時間 16,068 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,408 KB
testcase_01 AC 35 ms
53,408 KB
testcase_02 AC 1,303 ms
87,620 KB
testcase_03 AC 1,099 ms
84,800 KB
testcase_04 AC 641 ms
79,824 KB
testcase_05 AC 494 ms
78,612 KB
testcase_06 AC 251 ms
77,528 KB
testcase_07 AC 94 ms
76,152 KB
testcase_08 AC 302 ms
77,700 KB
testcase_09 AC 1,286 ms
87,252 KB
testcase_10 AC 36 ms
53,408 KB
testcase_11 AC 959 ms
83,228 KB
testcase_12 AC 1,040 ms
78,876 KB
testcase_13 AC 881 ms
82,980 KB
testcase_14 AC 1,337 ms
88,292 KB
testcase_15 AC 1,206 ms
86,024 KB
testcase_16 AC 131 ms
76,496 KB
testcase_17 AC 822 ms
81,964 KB
testcase_18 AC 709 ms
80,804 KB
testcase_19 AC 109 ms
76,248 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