結果

問題 No.68 よくある棒を切る問題 (2)
ユーザー rpy3cpprpy3cpp
提出日時 2015-07-22 19:32:51
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 1,597 ms / 5,000 ms
コード長 261 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 46,228 KB
最終ジャッジ日時 2023-08-25 02:16:04
合計ジャッジ時間 23,916 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,509 ms
45,540 KB
testcase_01 AC 1,597 ms
46,056 KB
testcase_02 AC 1,553 ms
45,464 KB
testcase_03 AC 1,391 ms
46,216 KB
testcase_04 AC 1,414 ms
46,116 KB
testcase_05 AC 1,400 ms
46,228 KB
testcase_06 AC 1,462 ms
43,116 KB
testcase_07 AC 1,522 ms
44,868 KB
testcase_08 AC 1,342 ms
43,352 KB
testcase_09 AC 1,418 ms
44,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N=input()
L=list(map(int,input().split()))
Q=input()
K=list(map(int,input().split()))
S=max(K)+1
W=[0]*S
L.sort(reverse=True)
h=[(-w,1) for w in L]
for k in range(1,S):
 w,n=h[0]
 W[k]=-w
 heapq.heapreplace(h,(w*n/(n+1),n+1))
for k in K:print(W[k])
0