結果

問題 No.9 モンスターのレベル上げ
ユーザー OKCH3COOHOKCH3COOH
提出日時 2019-10-23 22:16:27
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 2,966 ms / 5,000 ms
コード長 431 bytes
コンパイル時間 64 ms
使用メモリ 8,424 KB
最終ジャッジ日時 2023-02-10 07:34:22
合計ジャッジ時間 26,296 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 16 ms
7,660 KB
testcase_01 AC 16 ms
7,768 KB
testcase_02 AC 2,566 ms
8,004 KB
testcase_03 AC 2,033 ms
8,008 KB
testcase_04 AC 1,080 ms
8,188 KB
testcase_05 AC 721 ms
8,072 KB
testcase_06 AC 264 ms
7,868 KB
testcase_07 AC 21 ms
7,832 KB
testcase_08 AC 348 ms
7,796 KB
testcase_09 AC 2,584 ms
8,132 KB
testcase_10 AC 16 ms
7,816 KB
testcase_11 AC 2,314 ms
8,424 KB
testcase_12 AC 2,966 ms
8,072 KB
testcase_13 AC 2,175 ms
8,044 KB
testcase_14 AC 2,512 ms
8,084 KB
testcase_15 AC 2,269 ms
8,088 KB
testcase_16 AC 57 ms
7,688 KB
testcase_17 AC 1,472 ms
8,128 KB
testcase_18 AC 1,259 ms
8,184 KB
testcase_19 AC 39 ms
7,676 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