結果

問題 No.9 モンスターのレベル上げ
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-26 22:12:46
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 4,099 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 67 ms
使用メモリ 8,196 KB
最終ジャッジ日時 2023-01-21 16:06:19
合計ジャッジ時間 37,961 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 15 ms
7,668 KB
testcase_02 AC 3,735 ms
8,088 KB
testcase_03 AC 2,987 ms
8,088 KB
testcase_04 AC 1,625 ms
8,196 KB
testcase_05 AC 1,080 ms
7,972 KB
testcase_06 AC 385 ms
8,004 KB
testcase_07 AC 22 ms
7,828 KB
testcase_08 AC 521 ms
7,972 KB
testcase_09 AC 3,687 ms
8,096 KB
testcase_10 AC 16 ms
7,824 KB
testcase_11 AC 3,537 ms
8,044 KB
testcase_12 AC 4,099 ms
8,088 KB
testcase_13 AC 3,388 ms
8,196 KB
testcase_14 AC 3,663 ms
8,012 KB
testcase_15 AC 3,380 ms
8,132 KB
testcase_16 AC 78 ms
7,816 KB
testcase_17 AC 2,207 ms
8,144 KB
testcase_18 AC 1,880 ms
8,092 KB
testcase_19 AC 52 ms
7,664 KB
権限があれば一括ダウンロードができます

ソースコード

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