結果

問題 No.9 モンスターのレベル上げ
ユーザー zimphazimpha
提出日時 2017-12-07 01:29:05
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 1,394 ms / 5,000 ms
コード長 396 bytes
コンパイル時間 371 ms
使用メモリ 100,748 KB
最終ジャッジ日時 2023-01-21 16:55:51
合計ジャッジ時間 15,814 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 81 ms
75,560 KB
testcase_01 AC 81 ms
75,456 KB
testcase_02 AC 1,375 ms
100,264 KB
testcase_03 AC 1,180 ms
95,724 KB
testcase_04 AC 707 ms
88,004 KB
testcase_05 AC 552 ms
85,680 KB
testcase_06 AC 330 ms
83,344 KB
testcase_07 AC 144 ms
82,628 KB
testcase_08 AC 360 ms
83,944 KB
testcase_09 AC 1,394 ms
100,748 KB
testcase_10 AC 83 ms
75,808 KB
testcase_11 AC 1,032 ms
93,288 KB
testcase_12 AC 980 ms
91,660 KB
testcase_13 AC 944 ms
92,452 KB
testcase_14 AC 1,355 ms
100,384 KB
testcase_15 AC 1,236 ms
97,332 KB
testcase_16 AC 184 ms
82,524 KB
testcase_17 AC 919 ms
91,372 KB
testcase_18 AC 795 ms
89,412 KB
testcase_19 AC 164 ms
82,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ret = n
for i in range(n):
    pq = [(x, 0) for x in a]
    heapify(pq)
    mx = 0
    for j in range(n):
        e = b[(i + j) % n]
        u = heappop(pq)
        u = (u[0] + e // 2, u[1] + 1)
        heappush(pq, u)
    mx = max([e[1] for e in pq])
    ret = min(ret, mx)
print(ret)
0