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

19321번 - Longest Increasing Subsequence 스페셜 저지다국어

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

문제

Given $f_1, f_2, \ldots, f_n,ドル find a permutation $p_1, p_2, \ldots, p_n$ of integers 1,ドル 2, \ldots, n$ such that, for each $i,ドル the length of the longest strictly increasing subsequence ending with $p_i$ is $f_i$.

입력

The first line contains an integer $n$ (1ドル \leq n \leq 10^5$).

The second line contains $n$ integers $f_1, f_2, \ldots, f_n$ (1ドル \leq f_i \leq n$). It is guaranteed that, for the given input, at least one such permutation $p_1, p_2, \ldots, p_n$ exists.

출력

On the first line, print $n$ integers $p_1, p_2, \ldots, p_n$. These numbers must form a permutation of integers 1,ドル 2, \ldots, n$. If there are several possible answers, print any one of them.

제한

예제 입력 1

7
1 1 1 1 1 1 1

예제 출력 1

7 6 5 4 3 2 1

예제 입력 2

7
1 2 3 2 4 4 3

예제 출력 2

1 3 5 2 7 6 4

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2018 > Day 7: Ruyi Ji Contest 3 H번

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

출처

대학교 대회

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

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