結果

問題 No.9 モンスターのレベル上げ
ユーザー 👑 rin204rin204
提出日時 2022-06-12 15:51:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,070 ms / 5,000 ms
コード長 419 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 89,288 KB
最終ジャッジ日時 2023-10-24 11:45:35
合計ジャッジ時間 11,711 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,500 KB
testcase_01 AC 38 ms
53,500 KB
testcase_02 AC 1,070 ms
89,288 KB
testcase_03 AC 916 ms
85,556 KB
testcase_04 AC 562 ms
80,596 KB
testcase_05 AC 439 ms
79,528 KB
testcase_06 AC 274 ms
77,348 KB
testcase_07 AC 106 ms
76,268 KB
testcase_08 AC 313 ms
77,680 KB
testcase_09 AC 1,039 ms
88,456 KB
testcase_10 AC 36 ms
53,500 KB
testcase_11 AC 814 ms
84,000 KB
testcase_12 AC 659 ms
84,016 KB
testcase_13 AC 718 ms
83,312 KB
testcase_14 AC 1,039 ms
89,024 KB
testcase_15 AC 959 ms
87,328 KB
testcase_16 AC 142 ms
76,764 KB
testcase_17 AC 701 ms
83,132 KB
testcase_18 AC 599 ms
81,284 KB
testcase_19 AC 125 ms
76,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A.sort()
ans = 1 << 30
for i in range(n):
    hq = [(a, 0) for a in A]
    max_ = 0
    for j in range(i, i + n):
        if j >= n:
            j -= n
        a, t = heappop(hq)
        t += 1
        a += B[j] // 2
        max_ = max(max_, t)
        heappush(hq, (a, t))
    ans = min(ans, max_)
print(ans)
0