結果

問題 No.9 モンスターのレベル上げ
ユーザー ayame_pyayame_py
提出日時 2015-10-08 22:48:59
言語 Python2
(2.7.18)
結果
AC  
実行時間 4,780 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 6,760 KB
実行使用メモリ 6,560 KB
最終ジャッジ日時 2023-09-06 04:20:47
合計ジャッジ時間 35,689 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,060 KB
testcase_01 AC 12 ms
6,076 KB
testcase_02 AC 3,495 ms
6,344 KB
testcase_03 AC 2,727 ms
6,540 KB
testcase_04 AC 1,455 ms
6,228 KB
testcase_05 AC 969 ms
6,376 KB
testcase_06 AC 339 ms
6,148 KB
testcase_07 AC 19 ms
6,092 KB
testcase_08 AC 453 ms
6,416 KB
testcase_09 AC 3,391 ms
6,356 KB
testcase_10 AC 12 ms
6,268 KB
testcase_11 AC 3,238 ms
6,560 KB
testcase_12 AC 4,780 ms
6,352 KB
testcase_13 AC 3,277 ms
6,492 KB
testcase_14 AC 3,378 ms
6,364 KB
testcase_15 AC 3,112 ms
6,256 KB
testcase_16 AC 64 ms
6,348 KB
testcase_17 AC 1,984 ms
6,224 KB
testcase_18 AC 1,671 ms
6,372 KB
testcase_19 AC 42 ms
6,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import heapq
N = int(raw_input())
A = map(int, raw_input().split())
B = [int(x)/2 for x in raw_input().split()]

A.sort()
Aheap = [(a, 0) for a in A]
B_ = list(B)
B.extend(B_)

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

print ans
0