結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー gigurururu
提出日時 2014-11-06 18:01:10
言語 Python3
(3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 386 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 55 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2026-10-09 20:44:08
合計ジャッジ時間 23,305 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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