#721
Silver III
Making Mexes
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

You are given an array aa of NN non-negative integers a1,a2,,aNa_1, a_2, \dots, a_N (1N2105,0aiN1\le N\le 2\cdot 10^5, 0\le a_i\le N). In one operation, you can change any element of aa to any non-negative integer.

The mex of an array is the minimum non-negative integer that it does not contain. For each ii in the range 00 to NN inclusive, compute the minimum number of operations you need in order to make the mex of aa equal ii.

입력

The first line contains NN.

The next line contains a1,a2,,aNa_1,a_2,\dots, a_N.

출력

For each ii in the range 00 to NN, output the minimum number of operations for ii on a new line. Note that it is always possible to make the mex of aa equal to any ii in the range 00 to NN.

예제 입력 1

4
2 2 2 0

예제 출력 1

1
0
3
1
2

점수

Inputs 2-6: N103N\le 10^3Inputs 7-11: No additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Silver III1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.