結果

問題 No.9 モンスターのレベル上げ
ユーザー 双六双六
提出日時 2020-07-26 00:09:22
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 750 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 199,040 KB
最終ジャッジ日時 2023-09-10 02:19:26
合計ジャッジ時間 32,830 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
77,708 KB
testcase_01 AC 109 ms
72,500 KB
testcase_02 TLE -
testcase_03 AC 4,087 ms
166,680 KB
testcase_04 AC 2,254 ms
117,252 KB
testcase_05 AC 1,545 ms
99,780 KB
testcase_06 AC 662 ms
85,132 KB
testcase_07 AC 185 ms
80,080 KB
testcase_08 AC 827 ms
85,808 KB
testcase_09 TLE -
testcase_10 AC 109 ms
72,844 KB
testcase_11 AC 4,848 ms
196,304 KB
testcase_12 TLE -
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