| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 96 | 70 | 62 | 73.810% |
You are given an array $a$ of $N$ non-negative integers $a_1, a_2, \dots, a_N$ (1ドル\le N\le 2\cdot 10^5, 0\le a_i\le N$). In one operation, you can change any element of $a$ to any non-negative integer.
The mex of an array is the minimum non-negative integer that it does not contain. For each $i$ in the range 0ドル$ to $N$ inclusive, compute the minimum number of operations you need in order to make the mex of $a$ equal $i$.
The first line contains $N$.
The next line contains $a_1,a_2,\dots, a_N$.
For each $i$ in the range 0ドル$ to $N,ドル output the minimum number of operations for $i$ on a new line. Note that it is always possible to make the mex of $a$ equal to any $i$ in the range 0ドル$ to $N$.
4 2 2 2 0
1 0 3 1 2