結果

問題 No.9 モンスターのレベル上げ
ユーザー kou
提出日時 2019-12-16 22:21:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 411 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 18,080 KB
最終ジャッジ日時 2024-07-02 20:34:05
合計ジャッジ時間 6,968 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from heapq import *
from copy import deepcopy

n = int(input())
ans = 1 << 30
p = [(l, 0) for l in map(int, input().split())]
heapify(p)
enemies = list(map(int, input().split()))
for s in range(n):
	party = deepcopy(p)
	for i in range(n):
		l, t = heappop(party)
		heappush(party, (l + enemies[(s + i) % n] // 2, t + 1))
	ans = min(ans, max(x for _, x in party))
print(ans)
0