結果

問題 No.9 モンスターのレベル上げ
ユーザー koukou
提出日時 2019-12-16 22:28:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,304 ms / 5,000 ms
コード長 404 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 10,856 KB
実行使用メモリ 8,604 KB
最終ジャッジ日時 2023-09-15 18:37:09
合計ジャッジ時間 22,898 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,060 KB
testcase_01 AC 16 ms
7,988 KB
testcase_02 AC 2,304 ms
8,448 KB
testcase_03 AC 1,817 ms
8,396 KB
testcase_04 AC 960 ms
8,124 KB
testcase_05 AC 647 ms
8,032 KB
testcase_06 AC 240 ms
8,128 KB
testcase_07 AC 19 ms
8,024 KB
testcase_08 AC 317 ms
8,080 KB
testcase_09 AC 2,177 ms
8,432 KB
testcase_10 AC 16 ms
8,060 KB
testcase_11 AC 2,088 ms
8,604 KB
testcase_12 AC 2,195 ms
8,492 KB
testcase_13 AC 2,098 ms
7,940 KB
testcase_14 AC 2,220 ms
8,508 KB
testcase_15 AC 2,020 ms
8,532 KB
testcase_16 AC 56 ms
8,064 KB
testcase_17 AC 1,353 ms
8,344 KB
testcase_18 AC 1,105 ms
7,980 KB
testcase_19 AC 37 ms
8,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from heapq import *

n = int(input())
ans = 1 << 30
p = [l * 2000 for l in map(int, input().split())]
heapify(p)
enemies = list(map(int, input().split()))
for s in range(n):
	party = p[:]
	for i in range(n):
		x = heappop(party)
		heappush(party, (x // 2000 + enemies[(s + i) % n] // 2) * 2000 + x % 2000 + 1)
	ans = min(ans, max(x % 2000 for x in party))
print(ans)
0