結果

問題 No.9 モンスターのレベル上げ
ユーザー ayame_pyayame_py
提出日時 2015-10-08 23:23:07
言語 Python2
(2.7.18)
結果
AC  
実行時間 4,650 ms / 5,000 ms
コード長 348 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 6,684 KB
実行使用メモリ 6,428 KB
最終ジャッジ日時 2023-09-06 04:25:49
合計ジャッジ時間 34,258 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,160 KB
testcase_01 AC 12 ms
6,248 KB
testcase_02 AC 3,319 ms
6,356 KB
testcase_03 AC 2,606 ms
6,272 KB
testcase_04 AC 1,389 ms
6,228 KB
testcase_05 AC 929 ms
6,280 KB
testcase_06 AC 326 ms
6,288 KB
testcase_07 AC 17 ms
6,064 KB
testcase_08 AC 429 ms
6,356 KB
testcase_09 AC 3,265 ms
6,328 KB
testcase_10 AC 12 ms
6,096 KB
testcase_11 AC 3,071 ms
6,368 KB
testcase_12 AC 4,650 ms
6,336 KB
testcase_13 AC 3,099 ms
6,420 KB
testcase_14 AC 3,192 ms
6,428 KB
testcase_15 AC 2,949 ms
6,372 KB
testcase_16 AC 61 ms
6,216 KB
testcase_17 AC 1,896 ms
6,336 KB
testcase_18 AC 1,609 ms
6,372 KB
testcase_19 AC 41 ms
6,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(raw_input())
A = map(int, raw_input().split())
B = [int(x)//2 for x in raw_input().split()] * 2
A.sort()
Aheap = [(a, 0) for a in A]

ans = N
for i in range(N):
	a = list(Aheap)
	ansc = 0
	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