結果

問題 No.9 モンスターのレベル上げ
ユーザー H3PO4H3PO4
提出日時 2020-04-19 09:01:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,545 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-15 03:33:17
合計ジャッジ時間 24,321 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 2,488 ms
11,008 KB
testcase_03 AC 1,904 ms
11,008 KB
testcase_04 AC 1,044 ms
11,008 KB
testcase_05 AC 696 ms
11,008 KB
testcase_06 AC 261 ms
10,880 KB
testcase_07 AC 32 ms
10,752 KB
testcase_08 AC 339 ms
10,880 KB
testcase_09 AC 2,545 ms
11,008 KB
testcase_10 AC 28 ms
10,880 KB
testcase_11 AC 2,281 ms
11,008 KB
testcase_12 AC 2,392 ms
11,008 KB
testcase_13 AC 2,055 ms
11,136 KB
testcase_14 AC 2,332 ms
11,136 KB
testcase_15 AC 2,183 ms
11,008 KB
testcase_16 AC 67 ms
10,880 KB
testcase_17 AC 1,433 ms
11,008 KB
testcase_18 AC 1,187 ms
11,008 KB
testcase_19 AC 49 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq

N = int(input())
A = tuple(map(int, input().split()))
B = tuple(map(int, input().split())) * 2

ans = float('inf')
for i in range(N):
    heapq.heapify(h := [a * 10000 for a in A])
    for j in range(N):
        x = heapq.heappop(h)
        x += (B[i + j] // 2) * 10000 + 1
        heapq.heappush(h, x)
    ans = min(ans, max(a % 10000 for a in h))
print(ans)
0