結果

問題 No.9 モンスターのレベル上げ
ユーザー 双六双六
提出日時 2020-07-26 00:09:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 750 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 14,164 KB
最終ジャッジ日時 2023-09-10 02:19:34
合計ジャッジ時間 7,179 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,704 KB
testcase_01 AC 20 ms
8,744 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")
from heapq import heappop, heappush
import copy

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	A = list(sorted(getlist()))
	B = getlist()
	# [レベル、戦闘回数]
	Q = []
	for i in range(N):
		heappush(Q, [A[i], 0])

	ans = INF
	for i in range(N):
		start = i
		Q2 = copy.deepcopy(Q)
		for j in range(N):
			lv, cnt = heappop(Q2)
			lv += int((B[(start + j) % N]) // 2)
			cnt += 1
			heappush(Q2, [lv, cnt])

		val = 0
		for j in range(N):
			val = max(val, Q2[j][1])

		ans = min(ans, val)

	print(ans)


if __name__ == '__main__':
	main()
0