시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 591 370 300 66.372%

문제

1부터 N까지의 수들이 한 번씩 쓰인 수열이 있다. 그 수열에서 i 앞에 있는 수 들 중, i보다 큰 수들의 개수를 A[i]라고 정의하자. A[i]가 주어져 있을 때, 원래 수열을 구하는 프로그램을 작성하여라. 

입력

그리고 첫째 줄에 수열 원소의 개수 (1≤N≤100,000)이 주어진다. 그리고 두 번째 줄부터 N+1 번째 줄까지 차례로 A[i]가 주어진다.

출력

N개의 줄에 걸쳐서 수열을 출력한다. (i번째 줄에는 i번째 원소를 의미한다)

예제 입력 1

8
5
0
1
2
1
2
0
0

예제 출력 1

2
7
3
5
4
1
8
6
W3sicHJvYmxlbV9pZCI6IjE4NDkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyMWNcdWM1ZjQiLCJkZXNjcmlwdGlvbiI6IjxwPjFcdWJkODBcdWQxMzAgTlx1YWU0Y1x1YzljMFx1Yzc1OCBcdWMyMThcdWI0ZTRcdWM3NzQgXHVkNTVjIFx1YmM4OFx1YzUyOSBcdWM0ZjBcdWM3NzggXHVjMjE4XHVjNWY0XHVjNzc0IFx1Yzc4OFx1YjJlNC4gXHVhZGY4IFx1YzIxOFx1YzVmNFx1YzVkMFx1YzExYyBpIFx1YzU1ZVx1YzVkMCBcdWM3ODhcdWIyOTQgXHVjMjE4IFx1YjRlNCBcdWM5MTEsIGlcdWJjZjRcdWIyZTQgXHVkMDcwIFx1YzIxOFx1YjRlNFx1Yzc1OCBcdWFjMWNcdWMyMThcdWI5N2MgQVtpXVx1Yjc3Y1x1YWNlMCBcdWM4MTVcdWM3NThcdWQ1NThcdWM3OTAuIEFbaV1cdWFjMDAgXHVjOGZjXHVjNWI0XHVjODM4IFx1Yzc4OFx1Yzc0NCBcdWI1NGMsIFx1YzZkMFx1Yjc5OCBcdWMyMThcdWM1ZjRcdWM3NDQgXHVhZDZjXHVkNTU4XHViMjk0IFx1ZDUwNF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