結果

問題 No.9 モンスターのレベル上げ
ユーザー ayame_pyayame_py
提出日時 2015-10-08 22:32:52
言語 Python2
(2.7.18)
結果
AC  
実行時間 4,512 ms / 5,000 ms
コード長 450 bytes
コンパイル時間 38 ms
使用メモリ 6,956 KB
最終ジャッジ日時 2023-01-21 15:09:31
合計ジャッジ時間 35,523 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 12 ms
6,252 KB
testcase_01 AC 12 ms
6,104 KB
testcase_02 AC 3,496 ms
6,952 KB
testcase_03 AC 2,731 ms
6,544 KB
testcase_04 AC 1,458 ms
6,364 KB
testcase_05 AC 964 ms
6,276 KB
testcase_06 AC 339 ms
6,212 KB
testcase_07 AC 17 ms
6,948 KB
testcase_08 AC 449 ms
6,952 KB
testcase_09 AC 3,393 ms
6,948 KB
testcase_10 AC 11 ms
6,120 KB
testcase_11 AC 3,200 ms
6,676 KB
testcase_12 AC 4,512 ms
6,328 KB
testcase_13 AC 3,216 ms
6,956 KB
testcase_14 AC 3,392 ms
6,352 KB
testcase_15 AC 3,135 ms
6,948 KB
testcase_16 AC 64 ms
6,948 KB
testcase_17 AC 1,995 ms
6,400 KB
testcase_18 AC 1,664 ms
6,316 KB
testcase_19 AC 42 ms
6,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import heapq
N = int(raw_input())
A = map(int, raw_input().split())
B = map(int, raw_input().split())

Aheap = []
for i in range(len(A)):
	heapq.heappush(Aheap, (A[i], 0))

B = [b/2 for b in B]

ans = int(1e9+7)
for i in range(len(B)):
	a = list(Aheap)
	for j in range(len(B)):
		lv, c = a[0]
		#print str(lv) + ' ' + str(c)
		heapq.heapreplace(a, (lv+B[(i+j)%len(B)], c+1))
		#print a
	ans=min(ans, max(c for lv, c in a))

print ans
0