結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー yaoshimax
提出日時 2015-02-09 17:22:38
言語 PyPy2
(7.3.15)
結果
AC  
(最新)
TLE  
(最初)
実行時間 1,441 ms / 5,000 ms
コード長 388 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 77,808 KB
最終ジャッジ日時 2025-12-03 13:37:24
ジャッジサーバーID
(参考情報)
judge4 / judge1
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from heapq import heappush,heappop
N=int(raw_input())
A=map(int, raw_input().split())
B=map(int, raw_input().split())

ans = N
for i in range (N):
   pq=[]
   curAns = 0
   for a in A:
      heappush(pq,(a,0))
   for j in range(N):
      ind=(i+j)%N
      level,num=heappop(pq)
      heappush(pq,(level+B[ind]/2,num+1))
      curAns = max(curAns,num+1)
   ans = min(ans,curAns)
print ans
0