結果

問題 No.9 モンスターのレベル上げ
ユーザー TawaraTawara
提出日時 2016-07-27 00:02:26
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 3,414 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 971 ms
コンパイル使用メモリ 77,536 KB
実行使用メモリ 217,968 KB
最終ジャッジ日時 2023-09-06 04:53:40
合計ジャッジ時間 35,543 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
77,920 KB
testcase_01 AC 83 ms
77,976 KB
testcase_02 AC 3,414 ms
217,968 KB
testcase_03 AC 2,710 ms
171,748 KB
testcase_04 AC 1,539 ms
122,500 KB
testcase_05 AC 1,126 ms
103,972 KB
testcase_06 AC 571 ms
89,276 KB
testcase_07 AC 176 ms
81,224 KB
testcase_08 AC 669 ms
91,816 KB
testcase_09 AC 3,327 ms
215,128 KB
testcase_10 AC 85 ms
78,132 KB
testcase_11 AC 3,039 ms
215,640 KB
testcase_12 AC 2,939 ms
198,116 KB
testcase_13 AC 2,572 ms
152,332 KB
testcase_14 AC 3,335 ms
211,996 KB
testcase_15 AC 3,020 ms
201,108 KB
testcase_16 AC 258 ms
82,780 KB
testcase_17 AC 1,978 ms
135,620 KB
testcase_18 AC 1,746 ms
131,300 KB
testcase_19 AC 212 ms
81,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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