結果

問題 No.9 モンスターのレベル上げ
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-09 17:22:38
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 388 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 6,648 KB
実行使用メモリ 10,784 KB
最終ジャッジ日時 2023-09-05 21:05:26
合計ジャッジ時間 32,654 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,284 KB
testcase_01 AC 12 ms
6,224 KB
testcase_02 TLE -
testcase_03 AC 4,057 ms
6,312 KB
testcase_04 AC 2,185 ms
6,228 KB
testcase_05 AC 1,450 ms
6,320 KB
testcase_06 AC 523 ms
6,248 KB
testcase_07 AC 22 ms
6,160 KB
testcase_08 AC 685 ms
6,160 KB
testcase_09 TLE -
testcase_10 AC 12 ms
6,076 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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