結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,996 KB
testcase_01 AC 16 ms
8,096 KB
testcase_02 AC 2,890 ms
8,620 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 799 ms
8,552 KB
testcase_06 AC 286 ms
8,296 KB
testcase_07 AC 21 ms
8,060 KB
testcase_08 AC 382 ms
8,344 KB
testcase_09 AC 2,795 ms
8,704 KB
testcase_10 AC 16 ms
7,996 KB
testcase_11 AC 2,576 ms
8,476 KB
testcase_12 WA -
testcase_13 AC 2,537 ms
8,612 KB
testcase_14 AC 2,805 ms
8,648 KB
testcase_15 AC 2,569 ms
8,552 KB
testcase_16 AC 59 ms
7,992 KB
testcase_17 AC 1,634 ms
8,456 KB
testcase_18 WA -
testcase_19 AC 42 ms
8,044 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()]

A.sort()
Aheap = [(a, 0) for a in A]
B_ = list(B)
B.extend(B_)

ans = int(1e9+7)
for i in range(len(B_)):
	a = list(Aheap)
	for j in range(len(B_)):
		lv, c = a[0]
		#print str(lv) + ' ' + str(c)
		heapq.heapreplace(a, (lv+B[i+j], c+1))
		#print a
	ans=min(ans, max(c for lv, c in a))

print(ans)
0