시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 6 | 4 | 4 | 66.667% |
There is an array of $n$ integers. Each element $a_i$ in this array is between $1$ and $k$.
What is the smallest number of elements that should be removed from this array, so that its longest increasing subsequence has length smaller than $k$?
The first line contains two integers $n$ and $k$ ($1 \le n \le 10^6, 1 \le k \le n$) --- the length of the array and the upper bound for its elements.
The second line contains $n$ integers $a_i$ ($1 \le a_i \le k$) --- the elements of the array.
In the first line output an integer $m$ --- the number of elements to remove.
In the second line output $m$ integers --- the indices of the removed elements. The indices are numbered from $1$ to $n$.
3 2 1 2 2
1 1
2 2 2 1
0
8 3 1 2 2 1 1 3 2 3
2 1 7