結果

問題 No.9 モンスターのレベル上げ
ユーザー zimphazimpha
提出日時 2017-12-07 01:29:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,385 ms / 5,000 ms
コード長 396 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 96,776 KB
最終ジャッジ日時 2023-09-06 05:36:52
合計ジャッジ時間 15,027 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,436 KB
testcase_01 AC 78 ms
71,352 KB
testcase_02 AC 1,385 ms
96,776 KB
testcase_03 AC 1,136 ms
91,628 KB
testcase_04 AC 682 ms
84,408 KB
testcase_05 AC 514 ms
81,372 KB
testcase_06 AC 313 ms
79,492 KB
testcase_07 AC 136 ms
78,784 KB
testcase_08 AC 342 ms
80,056 KB
testcase_09 AC 1,359 ms
95,976 KB
testcase_10 AC 77 ms
71,364 KB
testcase_11 AC 1,030 ms
88,932 KB
testcase_12 AC 1,078 ms
87,156 KB
testcase_13 AC 948 ms
87,568 KB
testcase_14 AC 1,343 ms
96,744 KB
testcase_15 AC 1,249 ms
94,084 KB
testcase_16 AC 172 ms
78,616 KB
testcase_17 AC 876 ms
87,168 KB
testcase_18 AC 737 ms
84,720 KB
testcase_19 AC 150 ms
78,584 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