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

17170번 - Increasing Sequence 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 (추가 시간 없음) 1024 MB160513832.479%

문제

You are given a permutation of size $N$. For each $i,ドル print the number of indices $j \neq i,ドル which when removed, decreases the maximum possible length of an increasing subsequence that contains index $i$.

입력

The first line contains an integer $N$.

The next line contains $N$ integers $A_1, A_2, \cdots, A_N$.

출력

Print $N$ integers, separated by spaces, denoting the answers for $i = 1, 2, 3, \cdots, N$.

제한

  • 1ドル \leq N \leq 250,000円$
  • 1ドル \le A_i \le N$
  • Every element of $A$ is distinct.

서브태스크 1 (22점)

This subtask has an additional constraint:

  • $N \le 100$

서브태스크 2 (17점)

This subtask has an additional constraint:

  • $N \le 2,000円$

서브태스크 3 (61점)

This subtask has no additional constraints.

예제 입력 1

1
1

예제 출력 1

0

예제 입력 2

6
1 2 3 4 5 6

예제 출력 2

5 5 5 5 5 5

예제 입력 3

6
6 5 4 3 2 1

예제 출력 3

0 0 0 0 0 0

예제 입력 4

4
2 1 4 3

예제 출력 4

0 0 0 0

예제 입력 5

9
1 2 3 6 5 4 7 8 9

예제 출력 5

5 5 5 6 6 6 5 5 5

힌트

출처

University > KAIST > KAIST RUN Spring Contest > 2019 KAIST RUN Spring Contest G번

Contest > Open Cup > 2018/2019 Season > Stage 19: Grand Prix of Daejeon I번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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