結果

問題 No.9 モンスターのレベル上げ
ユーザー ayame_pyayame_py
提出日時 2015-10-08 22:32:52
言語 Python2
(2.7.18)
結果
AC  
実行時間 4,712 ms / 5,000 ms
コード長 450 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 6,576 KB
実行使用メモリ 6,564 KB
最終ジャッジ日時 2023-09-06 04:18:37
合計ジャッジ時間 36,410 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,324 KB
testcase_01 AC 13 ms
6,152 KB
testcase_02 AC 3,605 ms
6,412 KB
testcase_03 AC 2,832 ms
6,488 KB
testcase_04 AC 1,513 ms
6,496 KB
testcase_05 AC 995 ms
6,260 KB
testcase_06 AC 354 ms
6,184 KB
testcase_07 AC 19 ms
6,160 KB
testcase_08 AC 473 ms
6,196 KB
testcase_09 AC 3,538 ms
6,404 KB
testcase_10 AC 12 ms
6,084 KB
testcase_11 AC 3,365 ms
6,420 KB
testcase_12 AC 4,712 ms
6,300 KB
testcase_13 AC 3,354 ms
6,448 KB
testcase_14 AC 3,506 ms
6,564 KB
testcase_15 AC 3,169 ms
6,332 KB
testcase_16 AC 65 ms
6,192 KB
testcase_17 AC 2,031 ms
6,368 KB
testcase_18 AC 1,716 ms
6,300 KB
testcase_19 AC 43 ms
6,100 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