結果

問題 No.9 モンスターのレベル上げ
ユーザー ayame_pyayame_py
提出日時 2015-10-08 23:06:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 11,004 KB
実行使用メモリ 8,700 KB
最終ジャッジ日時 2023-09-27 08:12:32
合計ジャッジ時間 26,958 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,016 KB
testcase_01 AC 17 ms
7,960 KB
testcase_02 AC 2,687 ms
8,516 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 748 ms
8,368 KB
testcase_06 AC 274 ms
7,952 KB
testcase_07 AC 21 ms
8,084 KB
testcase_08 AC 363 ms
8,104 KB
testcase_09 AC 2,574 ms
8,516 KB
testcase_10 AC 17 ms
7,856 KB
testcase_11 AC 2,332 ms
8,500 KB
testcase_12 WA -
testcase_13 AC 2,312 ms
8,652 KB
testcase_14 AC 2,618 ms
8,520 KB
testcase_15 AC 2,374 ms
8,572 KB
testcase_16 AC 57 ms
8,032 KB
testcase_17 AC 1,562 ms
8,520 KB
testcase_18 WA -
testcase_19 AC 39 ms
8,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import heapq
N = int(input())
A = list(map(int, input().split()))
B = [int(x)/2 for x in input().split()] * 2
A.sort()
Aheap = [(a, 0) for a in A]

ans = N
for i in range(N):
	a = Aheap[:]
	for j in B[i:i+N]:
		lv, c = a[0]
		heapq.heapreplace(a, (lv+j, c+1))
	ans=min(ans, max(c for lv, c in a))

print(ans)
0