結果

問題 No.68 よくある棒を切る問題 (2)
コンテスト
ユーザー 👑 rin204
提出日時 2022-09-29 19:24:52
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 729 ms / 5,000 ms
+ 674µs
コード長 329 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 63 ms
コンパイル使用メモリ 81,872 KB
実行使用メモリ 164,196 KB
最終ジャッジ日時 2026-10-06 02:32:50
合計ジャッジ時間 13,486 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from heapq import *

n = int(input())
L = list(map(int, input().split()))
hq = [(-l, 1) for l in L]
heapify(hq)
ans = [-1]
for _ in range(500000):
    l, c = heappop(hq)
    l *= -1
    ans.append(l)
    heappush(hq, (-l * c / (c + 1), c + 1))

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

0