結果

問題 No.9 モンスターのレベル上げ
ユーザー gigurururugigurururu
提出日時 2014-11-06 18:01:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 10,832 KB
実行使用メモリ 8,776 KB
最終ジャッジ日時 2023-08-30 01:40:30
合計ジャッジ時間 30,755 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,032 KB
testcase_01 AC 17 ms
7,992 KB
testcase_02 AC 3,165 ms
8,776 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 884 ms
8,520 KB
testcase_06 AC 315 ms
8,460 KB
testcase_07 AC 22 ms
7,952 KB
testcase_08 AC 421 ms
8,324 KB
testcase_09 AC 3,075 ms
8,440 KB
testcase_10 AC 16 ms
8,040 KB
testcase_11 AC 2,591 ms
8,616 KB
testcase_12 WA -
testcase_13 AC 2,615 ms
8,604 KB
testcase_14 AC 3,087 ms
8,428 KB
testcase_15 AC 2,792 ms
8,696 KB
testcase_16 AC 63 ms
8,236 KB
testcase_17 AC 1,806 ms
8,440 KB
testcase_18 WA -
testcase_19 AC 44 ms
7,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq

n=int(input())
a=list(map(int,input().split()))+[1e9]
heapq.heapify(a)
a=[(i,0) for i in a]
b=[int(i)/2 for i in input().split()]

max_list=[]

for i in range(n):
    pq=a[:]
    for elevel in b[i:]+b[:i]:
        level,cnt=heapq.heappop(pq)
        heapq.heappush(pq,(level+elevel,cnt+1))
    max_list.append(max([y for x,y in pq]))

print(min(max_list))
0