結果

問題 No.68 よくある棒を切る問題 (2)
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-26 00:40:30
言語 Python2
(2.7.18)
結果
AC  
実行時間 2,520 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 6,660 KB
実行使用メモリ 55,300 KB
最終ジャッジ日時 2023-09-06 05:01:53
合計ジャッジ時間 35,244 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,470 ms
54,668 KB
testcase_01 AC 2,482 ms
54,504 KB
testcase_02 AC 2,512 ms
54,592 KB
testcase_03 AC 2,520 ms
55,300 KB
testcase_04 AC 2,417 ms
55,128 KB
testcase_05 AC 2,451 ms
55,124 KB
testcase_06 AC 2,232 ms
52,064 KB
testcase_07 AC 2,352 ms
53,240 KB
testcase_08 AC 2,213 ms
50,752 KB
testcase_09 AC 2,234 ms
52,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = [0.0 for i in xrange(500001)]
hp=[]
for l in L:
    heappush(hp,(-l,l,1))

for i in range(1,500001):
    (a,bar,n)=heappop(hp)
    ans[i]=-a
    heappush(hp,(-bar/(n+1.0),bar,n+1))

Q=int(raw_input())
K=map(int,raw_input().split())
for k in K:
    print ans[k]
0