結果

問題 No.9 モンスターのレベル上げ
ユーザー Tawara
提出日時 2016-07-27 00:02:26
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 3,265 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 76,872 KB
実行使用メモリ 237,728 KB
最終ジャッジ日時 2024-06-23 23:38:29
合計ジャッジ時間 33,227 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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