結果

問題 No.9 モンスターのレベル上げ
ユーザー OKCH3COOHOKCH3COOH
提出日時 2019-10-23 22:16:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,968 ms / 5,000 ms
コード長 431 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 8,496 KB
最終ジャッジ日時 2023-09-21 11:12:48
合計ジャッジ時間 26,451 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,992 KB
testcase_01 AC 16 ms
8,172 KB
testcase_02 AC 2,554 ms
8,452 KB
testcase_03 AC 2,003 ms
8,452 KB
testcase_04 AC 1,104 ms
8,460 KB
testcase_05 AC 738 ms
8,428 KB
testcase_06 AC 263 ms
8,284 KB
testcase_07 AC 20 ms
7,952 KB
testcase_08 AC 347 ms
8,480 KB
testcase_09 AC 2,522 ms
8,444 KB
testcase_10 AC 16 ms
8,028 KB
testcase_11 AC 2,420 ms
8,336 KB
testcase_12 AC 2,968 ms
8,368 KB
testcase_13 AC 2,243 ms
8,468 KB
testcase_14 AC 2,513 ms
8,404 KB
testcase_15 AC 2,314 ms
8,480 KB
testcase_16 AC 57 ms
8,048 KB
testcase_17 AC 1,520 ms
8,496 KB
testcase_18 AC 1,248 ms
8,444 KB
testcase_19 AC 40 ms
8,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heapify, heappop, heappush

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

myMonster = [(a, 0) for a in A]
heapify(myMonster)
ans = float('inf')

for start in range(N):
    A = myMonster[:]
    for b in B[start:] + B[:start]:
        now, time = heappop(A)
        now += b // 2
        heappush(A, (now, time + 1))
    ans = min(ans, max([a for _, a in A]))

print(ans)
0