結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー roiti46
提出日時 2015-02-16 23:51:36
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 428 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 77,628 KB
最終ジャッジ日時 2025-12-03 13:55:12
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import copy,heapq
N = int(raw_input())
_A = zip(map(int,raw_input().split()),[0]*N)
B = map(int,raw_input().split())

ans = 1500
for sp in xrange(N):
    A = copy.deepcopy(_A)
    heapq.heapify(A)
    for i in xrange(sp, N+sp):
        i %= N
        a = list(heapq.heappop(A))
        a[0] += B[i]/2
        a[1] += 1
        heapq.heappush(A,tuple(a))
    ans = min(ans, max(heapq.heappop(A)[1] for i in xrange(N)))
print ans
0