結果

問題 No.9 モンスターのレベル上げ
ユーザー ayame_pyayame_py
提出日時 2015-10-08 23:05:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 10,796 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-09-27 08:12:00
合計ジャッジ時間 30,592 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,040 KB
testcase_01 AC 14 ms
8,092 KB
testcase_02 AC 3,116 ms
8,592 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 888 ms
8,412 KB
testcase_06 AC 304 ms
8,024 KB
testcase_07 AC 19 ms
8,012 KB
testcase_08 AC 413 ms
8,008 KB
testcase_09 AC 2,975 ms
8,572 KB
testcase_10 AC 15 ms
8,040 KB
testcase_11 AC 2,725 ms
8,416 KB
testcase_12 WA -
testcase_13 AC 2,725 ms
8,704 KB
testcase_14 AC 2,983 ms
8,516 KB
testcase_15 AC 2,633 ms
8,700 KB
testcase_16 AC 61 ms
8,008 KB
testcase_17 AC 1,692 ms
8,456 KB
testcase_18 WA -
testcase_19 AC 41 ms
7,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import heapq
N = int(input())
A = list(map(int, input().split()))
B = [int(x)/2 for x in input().split()] * 2
A.sort()
Aheap = [(a, 0) for a in A]

ans = N
for i in range(N):
	a = Aheap[:]
	ansc = 0
	for j in B[i:i+N]:
		lv, c = a[0]
		heapq.heapreplace(a, (lv+j, c+1))
		ansc = max(ansc, c+1)
	ans=min(ans, ansc)

print(ans)
0