結果

問題 No.9 モンスターのレベル上げ
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-09 17:56:53
言語 Python2
(2.7.18)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 392 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 6,456 KB
実行使用メモリ 6,636 KB
最終ジャッジ日時 2023-09-05 21:08:21
合計ジャッジ時間 46,224 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,072 KB
testcase_01 AC 12 ms
6,116 KB
testcase_02 AC 4,608 ms
6,520 KB
testcase_03 AC 3,593 ms
6,408 KB
testcase_04 AC 1,912 ms
6,312 KB
testcase_05 AC 1,280 ms
6,372 KB
testcase_06 AC 459 ms
6,268 KB
testcase_07 AC 20 ms
6,040 KB
testcase_08 AC 601 ms
6,460 KB
testcase_09 AC 4,471 ms
6,424 KB
testcase_10 AC 12 ms
6,032 KB
testcase_11 AC 4,221 ms
6,512 KB
testcase_12 TLE -
testcase_13 AC 4,241 ms
6,400 KB
testcase_14 AC 4,433 ms
6,512 KB
testcase_15 AC 4,181 ms
6,376 KB
testcase_16 AC 84 ms
6,208 KB
testcase_17 AC 2,629 ms
6,312 KB
testcase_18 AC 2,203 ms
6,344 KB
testcase_19 AC 53 ms
6,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = N
for i in xrange(N):
   curB=B[i:]+B[:i]
   curAns = 0
   pq = zip(A,[0 for i in range(N)])
   heapify(pq)
   for b in curB:
      level,num=heappop(pq)
      heappush(pq,(level+b/2,num+1))
      curAns = max(curAns,num+1)
   ans = min(ans,curAns)
print ans
0