結果
| 問題 | No.68 よくある棒を切る問題 (2) | 
| コンテスト | |
| ユーザー |  convexineq | 
| 提出日時 | 2021-05-13 13:04:26 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 396 bytes | 
| コンパイル時間 | 383 ms | 
| コンパイル使用メモリ | 82,372 KB | 
| 実行使用メモリ | 104,876 KB | 
| 最終ジャッジ日時 | 2024-09-25 02:25:47 | 
| 合計ジャッジ時間 | 8,990 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 10 | 
ソースコード
from heapq import *
n = int(input())
*a, = map(int,input().split())
a.sort()
q = [(-ai*1.0,1) for ai in a]
cnt = 1
Q = int(input())
*k, = map(int,input().split())
ans = [0.0]*Q
order = sorted(range(n),key = lambda i:k[i])
for i in order:
    for _ in range(k[i]-cnt):
        v,c = heappop(q)
        heappush(q,(v*c/(c+1),c+1))
    ans[i] = -q[0][0]
    cnt = k[i]
print("\n".join(map(str,ans)))
            
            
            
        