結果
問題 | No.68 よくある棒を切る問題 (2) |
ユーザー |
![]() |
提出日時 | 2020-03-24 15:29:04 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 2,295 ms / 5,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 262 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 53,656 KB |
最終ジャッジ日時 | 2024-12-31 15:04:58 |
合計ジャッジ時間 | 32,712 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from heapq import heapify, heappushpop N = int(readline()) q = [(-int(x), 1) for x in readline().split()] Q = int(readline()) K = tuple(map(int, readline().split())) U = 5 * 10**5 answer = [0] * (U + 1) heapify(q) for i in range(1, U + 1): x, j = q[0] answer[i] = -x x *= j j += 1 x /= j heappushpop(q, (x, j)) print('\n'.join(str(answer[k]) for k in K))