結果

問題 No.9 モンスターのレベル上げ
ユーザー koukou
提出日時 2019-12-16 22:34:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 511 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 8,896 KB
最終ジャッジ日時 2023-09-15 18:43:39
合計ジャッジ時間 17,644 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,664 KB
testcase_01 AC 18 ms
8,672 KB
testcase_02 AC 1,770 ms
8,896 KB
testcase_03 WA -
testcase_04 AC 748 ms
8,672 KB
testcase_05 WA -
testcase_06 AC 191 ms
8,668 KB
testcase_07 AC 22 ms
8,524 KB
testcase_08 AC 246 ms
8,636 KB
testcase_09 AC 1,728 ms
8,868 KB
testcase_10 AC 19 ms
8,668 KB
testcase_11 AC 1,568 ms
8,828 KB
testcase_12 AC 1,636 ms
8,736 KB
testcase_13 AC 1,410 ms
8,896 KB
testcase_14 AC 1,718 ms
8,752 KB
testcase_15 AC 1,569 ms
8,756 KB
testcase_16 WA -
testcase_17 AC 1,016 ms
8,816 KB
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def main():
	n = int(input())
	ans = 1 << 30
	p = [l * 1510 for l in map(int, input().split())]
	heapify(p)
	enemies = deque(map(int, input().split()))
	for s in range(n):
		party = p[:]
		for el in enemies:
			x = heappop(party)
			heappush(party, (x // 1510 + enemies[el % n] // 2) * 1510 + x % 1510 + 1)
		ans = min(ans, max(x % 1510 for x in party))
		enemies.rotate(1)
	print(ans)

if __name__ == "__main__":
	main()
0