結果

問題 No.9 モンスターのレベル上げ
ユーザー koukou
提出日時 2019-12-16 22:28:03
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 2,230 ms / 5,000 ms
コード長 404 bytes
コンパイル時間 61 ms
使用メモリ 8,096 KB
最終ジャッジ日時 2023-02-03 22:32:11
合計ジャッジ時間 22,764 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 16 ms
7,792 KB
testcase_01 AC 15 ms
7,660 KB
testcase_02 AC 2,230 ms
7,972 KB
testcase_03 AC 1,799 ms
7,876 KB
testcase_04 AC 955 ms
7,988 KB
testcase_05 AC 652 ms
7,808 KB
testcase_06 AC 235 ms
7,792 KB
testcase_07 AC 20 ms
7,816 KB
testcase_08 AC 316 ms
7,716 KB
testcase_09 AC 2,194 ms
8,088 KB
testcase_10 AC 16 ms
7,604 KB
testcase_11 AC 2,105 ms
8,096 KB
testcase_12 AC 2,181 ms
7,992 KB
testcase_13 AC 1,962 ms
7,836 KB
testcase_14 AC 2,208 ms
7,968 KB
testcase_15 AC 2,032 ms
7,836 KB
testcase_16 AC 52 ms
7,988 KB
testcase_17 AC 1,289 ms
7,856 KB
testcase_18 AC 1,101 ms
7,808 KB
testcase_19 AC 36 ms
7,920 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