結果

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

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 12 ms
6,108 KB
testcase_01 AC 12 ms
6,368 KB
testcase_02 AC 4,432 ms
6,596 KB
testcase_03 AC 3,523 ms
6,616 KB
testcase_04 AC 1,882 ms
6,352 KB
testcase_05 AC 1,255 ms
6,332 KB
testcase_06 AC 445 ms
6,284 KB
testcase_07 AC 19 ms
6,136 KB
testcase_08 AC 582 ms
6,464 KB
testcase_09 AC 4,389 ms
6,436 KB
testcase_10 AC 12 ms
6,136 KB
testcase_11 AC 4,046 ms
6,656 KB
testcase_12 TLE -
testcase_13 AC 4,059 ms
6,460 KB
testcase_14 AC 4,315 ms
6,572 KB
testcase_15 AC 3,903 ms
6,632 KB
testcase_16 AC 81 ms
6,328 KB
testcase_17 AC 2,555 ms
6,404 KB
testcase_18 AC 2,140 ms
6,444 KB
testcase_19 AC 52 ms
6,196 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