結果

問題 No.9 モンスターのレベル上げ
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-26 22:12:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 4,110 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 10,924 KB
実行使用メモリ 8,680 KB
最終ジャッジ日時 2023-09-06 04:59:31
合計ジャッジ時間 37,307 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,956 KB
testcase_01 AC 17 ms
8,080 KB
testcase_02 AC 3,784 ms
8,520 KB
testcase_03 AC 2,941 ms
8,416 KB
testcase_04 AC 1,583 ms
8,576 KB
testcase_05 AC 1,084 ms
8,356 KB
testcase_06 AC 392 ms
7,944 KB
testcase_07 AC 23 ms
8,120 KB
testcase_08 AC 517 ms
7,996 KB
testcase_09 AC 3,752 ms
8,680 KB
testcase_10 AC 16 ms
8,108 KB
testcase_11 AC 3,525 ms
8,540 KB
testcase_12 AC 4,110 ms
8,472 KB
testcase_13 AC 3,429 ms
8,488 KB
testcase_14 AC 3,660 ms
8,552 KB
testcase_15 AC 3,277 ms
8,520 KB
testcase_16 AC 77 ms
8,076 KB
testcase_17 AC 2,110 ms
8,424 KB
testcase_18 AC 1,847 ms
8,516 KB
testcase_19 AC 51 ms
7,956 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