結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,008 KB
testcase_01 AC 17 ms
7,992 KB
testcase_02 AC 2,576 ms
8,464 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 700 ms
8,500 KB
testcase_06 AC 260 ms
8,020 KB
testcase_07 AC 20 ms
7,996 KB
testcase_08 AC 331 ms
8,084 KB
testcase_09 AC 2,423 ms
8,596 KB
testcase_10 AC 15 ms
7,996 KB
testcase_11 AC 2,239 ms
8,336 KB
testcase_12 WA -
testcase_13 AC 2,158 ms
8,604 KB
testcase_14 AC 2,377 ms
8,596 KB
testcase_15 AC 2,255 ms
8,708 KB
testcase_16 AC 54 ms
7,988 KB
testcase_17 AC 1,435 ms
8,464 KB
testcase_18 WA -
testcase_19 AC 35 ms
8,000 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))
	ansc=max(c for lv, c in a)
	if ans > ansc:
		ans = ansc

print(ans)
0