結果

問題 No.9 モンスターのレベル上げ
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-26 22:13:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,422 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 513 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 94,532 KB
最終ジャッジ日時 2023-09-06 04:58:14
合計ジャッジ時間 15,262 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,552 KB
testcase_01 AC 75 ms
71,616 KB
testcase_02 AC 1,422 ms
94,532 KB
testcase_03 AC 1,178 ms
89,152 KB
testcase_04 AC 704 ms
83,060 KB
testcase_05 AC 536 ms
81,628 KB
testcase_06 AC 319 ms
79,356 KB
testcase_07 AC 132 ms
78,548 KB
testcase_08 AC 354 ms
79,724 KB
testcase_09 AC 1,397 ms
92,848 KB
testcase_10 AC 75 ms
71,380 KB
testcase_11 AC 1,004 ms
89,308 KB
testcase_12 AC 1,013 ms
87,668 KB
testcase_13 AC 925 ms
87,872 KB
testcase_14 AC 1,376 ms
94,368 KB
testcase_15 AC 1,284 ms
91,452 KB
testcase_16 AC 176 ms
78,636 KB
testcase_17 AC 890 ms
85,560 KB
testcase_18 AC 768 ms
83,648 KB
testcase_19 AC 153 ms
78,308 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