結果

問題 No.9 モンスターのレベル上げ
ユーザー tookunn_1213
提出日時 2016-08-26 22:13:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,377 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 683 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 92,360 KB
最終ジャッジ日時 2024-06-23 23:42:41
合計ジャッジ時間 15,098 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
ans = 10 ** 9 + 7
for i in range(N):
	pq = [(j,0) for j in A]
	heapq.heapify(pq)
	battle = 0
	for j in range(N):
		p = heapq.heappop(pq)
		next = (p[0] + (B[(i + j) % N]//2),p[1] + 1)
		battle = max(battle,next[1])
		heapq.heappush(pq,next)
	ans = min(ans,battle)
print(ans)
0