結果

問題 No.9 モンスターのレベル上げ
ユーザー zer0zer0
提出日時 2020-03-30 23:54:10
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 475 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 149,668 KB
最終ジャッジ日時 2023-09-05 11:42:41
合計ジャッジ時間 7,128 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,776 KB
testcase_01 AC 93 ms
71,496 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
import copy
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ahq = []
for i in a:
    heapq.heappush(ahq, [i, 0])

ans = 10 ** 18
for i in range(N):
    tans = 0
    hq = copy.deepcopy(ahq)
    for j in range(i, N + i):
        l, c = heapq.heappop(hq)
        heapq.heappush(hq, [l + (b[j % N] // 2), c + 1])
    while hq:
        l, c = heapq.heappop(hq)
        tans = max(tans, c)
    ans = min(ans, tans)

print(tans)
0