結果

問題 No.9 モンスターのレベル上げ
ユーザー mlihua09mlihua09
提出日時 2020-09-01 17:41:07
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 1,268 ms / 5,000 ms
コード長 401 bytes
コンパイル時間 319 ms
使用メモリ 86,748 KB
最終ジャッジ日時 2022-12-25 22:45:10
合計ジャッジ時間 15,032 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 85 ms
75,544 KB
testcase_01 AC 80 ms
75,768 KB
testcase_02 AC 1,239 ms
86,520 KB
testcase_03 AC 1,019 ms
86,644 KB
testcase_04 AC 644 ms
83,796 KB
testcase_05 AC 494 ms
83,416 KB
testcase_06 AC 325 ms
83,624 KB
testcase_07 AC 167 ms
82,620 KB
testcase_08 AC 353 ms
83,304 KB
testcase_09 AC 1,268 ms
86,208 KB
testcase_10 AC 91 ms
75,540 KB
testcase_11 AC 987 ms
85,580 KB
testcase_12 AC 1,087 ms
85,620 KB
testcase_13 AC 831 ms
84,620 KB
testcase_14 AC 1,222 ms
86,748 KB
testcase_15 AC 1,130 ms
86,004 KB
testcase_16 AC 221 ms
82,872 KB
testcase_17 AC 822 ms
85,728 KB
testcase_18 AC 711 ms
84,388 KB
testcase_19 AC 203 ms
82,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())

A = list(map(lambda x: int(x) * 2000, input().split()))
B = list(map(int, input().split()))
ans = N
for i in range(-N + 1, 1):
    a = A.copy()
    heapq.heapify(a)
    x = 0
    for j in range(i, i + N):
        r = heapq.heappop(a)
        r += 1 + 2000 * (B[j] // 2)
        x = max(r % 2000, x)
        heapq.heappush(a, r)
        
    ans = min(ans, x)
print(ans)
0