結果

問題 No.9 モンスターのレベル上げ
ユーザー TawaraTawara
提出日時 2016-07-27 00:30:46
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 1,149 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 78,204 KB
実行使用メモリ 91,780 KB
最終ジャッジ日時 2023-09-06 04:55:12
合計ジャッジ時間 13,443 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
77,896 KB
testcase_01 AC 78 ms
78,156 KB
testcase_02 AC 1,148 ms
91,716 KB
testcase_03 AC 940 ms
88,896 KB
testcase_04 AC 601 ms
83,840 KB
testcase_05 AC 453 ms
82,940 KB
testcase_06 AC 279 ms
82,220 KB
testcase_07 AC 129 ms
80,360 KB
testcase_08 AC 293 ms
81,728 KB
testcase_09 AC 1,149 ms
91,460 KB
testcase_10 AC 79 ms
78,156 KB
testcase_11 AC 852 ms
86,436 KB
testcase_12 AC 1,005 ms
82,404 KB
testcase_13 AC 762 ms
84,856 KB
testcase_14 AC 1,129 ms
91,780 KB
testcase_15 AC 1,058 ms
89,872 KB
testcase_16 AC 170 ms
81,532 KB
testcase_17 AC 741 ms
86,404 KB
testcase_18 AC 646 ms
84,920 KB
testcase_19 AC 148 ms
80,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq as hpq
def solve():
	N = int(raw_input())
	ans = N+1
	Q = [(a,0) for a in map(int,raw_input().split())]
	hpq.heapify(Q)
	B = map(int,raw_input().split())
	for i in xrange(N):
		q = Q[:]
		for j in xrange(N):
			lv,cnt = hpq.heappop(q)
			hpq.heappush(q,(lv+B[(i+j)%N]/2,cnt+1))
		ans = min(ans,max(q,key=lambda x:x[1])[1])
	print ans
solve()
0