結果

問題 No.9 モンスターのレベル上げ
ユーザー mlihua09mlihua09
提出日時 2020-09-01 17:41:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,172 ms / 5,000 ms
コード長 401 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 80,392 KB
最終ジャッジ日時 2024-04-30 02:50:58
合計ジャッジ時間 12,645 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,736 KB
testcase_01 AC 42 ms
52,224 KB
testcase_02 AC 1,143 ms
80,392 KB
testcase_03 AC 954 ms
79,492 KB
testcase_04 AC 590 ms
78,048 KB
testcase_05 AC 434 ms
77,292 KB
testcase_06 AC 258 ms
77,324 KB
testcase_07 AC 104 ms
76,416 KB
testcase_08 AC 283 ms
77,184 KB
testcase_09 AC 1,118 ms
80,032 KB
testcase_10 AC 36 ms
52,608 KB
testcase_11 AC 867 ms
78,892 KB
testcase_12 AC 965 ms
79,536 KB
testcase_13 AC 777 ms
78,640 KB
testcase_14 AC 1,172 ms
80,204 KB
testcase_15 AC 1,035 ms
79,444 KB
testcase_16 AC 154 ms
76,880 KB
testcase_17 AC 766 ms
78,828 KB
testcase_18 AC 653 ms
78,532 KB
testcase_19 AC 143 ms
77,516 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