結果

問題 No.9 モンスターのレベル上げ
ユーザー tookunn_1213
提出日時 2016-08-26 22:12:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 380 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-06-23 23:43:54
合計ジャッジ時間 43,614 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

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