結果

問題 No.9 モンスターのレベル上げ
ユーザー TawaraTawara
提出日時 2016-07-27 00:13:50
言語 PyPy2
(7.3.15)
結果
RE  
実行時間 -
コード長 404 bytes
コンパイル時間 735 ms
コンパイル使用メモリ 76,928 KB
実行使用メモリ 205,912 KB
最終ジャッジ日時 2024-04-24 09:44:32
合計ジャッジ時間 29,127 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
76,800 KB
testcase_01 AC 87 ms
76,800 KB
testcase_02 AC 2,705 ms
201,944 KB
testcase_03 AC 2,136 ms
157,908 KB
testcase_04 AC 1,260 ms
113,620 KB
testcase_05 AC 896 ms
98,308 KB
testcase_06 AC 445 ms
85,140 KB
testcase_07 AC 139 ms
80,024 KB
testcase_08 AC 518 ms
87,596 KB
testcase_09 AC 2,696 ms
199,024 KB
testcase_10 RE -
testcase_11 AC 2,528 ms
205,912 KB
testcase_12 WA -
testcase_13 AC 2,034 ms
141,148 KB
testcase_14 AC 2,662 ms
199,000 KB
testcase_15 AC 2,516 ms
186,424 KB
testcase_16 AC 203 ms
80,724 KB
testcase_17 AC 1,632 ms
133,084 KB
testcase_18 AC 1,433 ms
122,060 KB
testcase_19 AC 209 ms
80,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq as hpq
from copy import deepcopy as dcp
def solve():
	Q = []
	ans = N = int(raw_input())
	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 = dcp(Q)
		lv,cnt = hpq.heappop(q)
		for j in xrange(N):
			lv,cnt = hpq.heapreplace(q,(lv+B[(j+i)%N]/2,cnt+1))
		ans = min(ans,max(q,key=lambda x:x[1])[1])
	print ans 
solve()
0