結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー gigurururu
提出日時 2014-11-05 21:35:32
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 1,508 ms / 5,000 ms
コード長 414 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 77,352 KB
最終ジャッジ日時 2025-12-03 12:55:34
ジャッジサーバーID
(参考情報)
judge1 / judge2
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import heapq
from collections import deque

n=input()
a=map(int,raw_input().split())+[1e9]
b=deque(map(int,raw_input().split()))

max_list=[]

for _ in range(n):
    pq=[(j,0) for j in a]
    heapq.heapify(pq)
    for elevel in b:
        level,cnt=heapq.heappop(pq)
        heapq.heappush(pq,(level+elevel/2,cnt+1))
    max_list.append(max([y for x,y in pq]))
    b.rotate()

print min(max_list)
0