Logo
(追記) (追記ここまで)

35011번 - Competition Results 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB999100.000%

문제

There are $n$ runners participating in a race. Each runner is assigned a unique number from 1ドル$ to $n$. They have arrived at the finish line in some specific order, with no ties. Let us say that runner $i$ has performed an upset of runner $j$ if $i$ finished before $j$ and $i < j$.

For each $i$ from 1ドル$ to $n,ドル it is known that runner $i$ has performed exactly $a_i$ upsets of other runners. Your task is to restore the competition results: the number of the runner that took first place, the number of the runner that took second place, \ldots, the number of the runner that took the $n$-th place. It can be shown that the answer is always unique, assuming that it exists.

입력

The first line of the input contains an integer $n$ from 1ドル$ to 1000ドル$: the number of runners.

The second line contains $n$ space-delimited integers $a_1, a_2, \ldots, a_n,ドル where $a_i$ is the number of upsets performed by runner $i$.

The given data is consistent with some possible results of the competition: for every $i,ドル it is true that $a_i \le n - i$. In particular, $a_n = 0$.

출력

Print $n$ space-separated integers: the numbers of runners who took first, second, \ldots, $n$-th place.

제한

예제 입력 1

5
3 0 2 1 0

예제 출력 1

3 1 4 5 2

예제 입력 2

1
0

예제 출력 2

1

예제 입력 3

2
0 0

예제 출력 3

2 1

노트

Let us check that the answer to the first example is consistent with the given numbers $a_i$.

  1. Runner 1ドル$ has upset runners 2ドル,ドル 4ドル,ドル and 5ドル$.
  2. Runner 2ドル$ took the last place and, therefore, has not outperformed anyone. Hence, runner 2ドル$ has performed no upsets.
  3. The runner with the number 3ドル$ took the first place and, therefore, has upset both runners with larger numbers.
  4. The runner with the number 4ドル$ has upset a single other runner: runner 5ドル$.
  5. There are no runners with numbers larger than 5ドル$. Therefore, runner 5ドル$ has performed no upsets.

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2025-2026 Northwestern Russia Qualification H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /