結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー gigurururu
提出日時 2014-11-05 21:35:32
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 983 ms / 5,000 ms
+ 273µs
コード長 414 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 66 ms
コンパイル使用メモリ 80,896 KB
実行使用メモリ 99,320 KB
最終ジャッジ日時 2026-07-17 07:45:23
合計ジャッジ時間 11,876 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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