結果
| 問題 |
No.68 よくある棒を切る問題 (2)
|
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2021-01-25 02:01:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,098 ms / 5,000 ms |
| コード長 | 387 bytes |
| コンパイル時間 | 306 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 131,064 KB |
| 最終ジャッジ日時 | 2024-06-11 20:13:42 |
| 合計ジャッジ時間 | 18,167 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
from heapq import heappop, heappush, heapify
n = int(input())
l = list(map(int, input().split()))
d = [0] * (5 * 10 ** 5 + 1)
cnt = [0] * n
q = [(-l[i], i) for i in range(n)]
heapify(q)
for c in range(1, 5 * 10 ** 5 + 1):
x, i = heappop(q)
x = -x
d[c] = x
cnt[i] += 1
heappush(q, (-l[i] / (cnt[i] + 1), i))
input()
for k in map(int, input().split()):
print(d[k])
Kude