結果

問題 No.9 モンスターのレベル上げ
ユーザー koukou
提出日時 2019-12-16 22:37:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,560 ms / 5,000 ms
コード長 497 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 8,884 KB
最終ジャッジ日時 2023-09-15 18:42:11
合計ジャッジ時間 15,775 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,580 KB
testcase_01 AC 18 ms
8,568 KB
testcase_02 AC 1,560 ms
8,756 KB
testcase_03 AC 1,215 ms
8,764 KB
testcase_04 AC 661 ms
8,696 KB
testcase_05 AC 447 ms
8,688 KB
testcase_06 AC 171 ms
8,624 KB
testcase_07 AC 22 ms
8,556 KB
testcase_08 AC 219 ms
8,636 KB
testcase_09 AC 1,514 ms
8,884 KB
testcase_10 AC 18 ms
8,628 KB
testcase_11 AC 1,381 ms
8,764 KB
testcase_12 AC 1,496 ms
8,712 KB
testcase_13 AC 1,268 ms
8,780 KB
testcase_14 AC 1,516 ms
8,880 KB
testcase_15 AC 1,383 ms
8,748 KB
testcase_16 AC 43 ms
8,580 KB
testcase_17 AC 901 ms
8,728 KB
testcase_18 AC 759 ms
8,860 KB
testcase_19 AC 34 ms
8,704 KB
権限があれば一括ダウンロードができます

ソースコード

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 _ in range(n):
		party = p[:]
		for el in enemies:
			x = heappop(party)
			heappush(party, (x // 1510 + el // 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