1 人解决,2 人已尝试。
2 份提交通过,共有 4 份提交。
9.6 EMB 奖励。
单点时限: 3.0 sec
内存限制: 256 MB
You are given a list of $n$ integers $a_1, \ldots, a_n$. You can perform the following operation: choose some $a_i$ and multiply it by any positive integer.
Your task is to compute the minimum number of different integers that could be on the list after $k$ operations for all $0 \leq k \leq n$.
The first line of the input contains single integer $n$ ($1 \leq n \leq 3 \cdot 10^5$).
The second line of the input contains $n$ integers $a_i$ ($1 \leq a_i \leq 10^6$).
Output a single line that contains $n + 1$ integers. The $i$-th integer should be the minimum possible number of different integers in the list after $i - 1$ operations.
6 3 4 1 2 1 2
4 4 3 3 2 2 1
1 人解决,2 人已尝试。
2 份提交通过,共有 4 份提交。
9.6 EMB 奖励。