結果
| 問題 | No.68 よくある棒を切る問題 (2) | 
| コンテスト | |
| ユーザー |  rkyiolklo | 
| 提出日時 | 2020-04-21 00:19:10 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,666 ms / 5,000 ms | 
| コード長 | 435 bytes | 
| コンパイル時間 | 106 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 52,100 KB | 
| 最終ジャッジ日時 | 2024-10-06 09:39:17 | 
| 合計ジャッジ時間 | 23,862 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
import heapq 
def solve():
    n = int(input())
    L = list(map(int,input().split()))
    q = int(input())
    k = list(map(int,input().split()))
    h = []
    for i in range(n):
        heapq.heappush(h, (-L[i], 1, i))
    max = 500001
    a = [0.0] * max 
    for j in range(1, max):
        l, n, i = h[0]
        a[j] = -l 
        heapq.heapreplace(h, (-L[i]/(n + 1), n + 1, i))
    for k_ in k:
        print(a[k_])
solve()
            
            
            
        