結果
問題 | No.68 よくある棒を切る問題 (2) |
ユーザー |
👑 |
提出日時 | 2022-09-29 19:24:52 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,383 ms / 5,000 ms |
コード長 | 329 bytes |
コンパイル時間 | 226 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 158,556 KB |
最終ジャッジ日時 | 2024-12-22 18:18:39 |
合計ジャッジ時間 | 22,922 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
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 *= -1ans.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])