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

15517번 - Array Manipulation at Moloco (Hard) 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB32618916566.265%

문제

At Moloco, management and analysis of big data is an important part of its core business solution. One day, a very complicated issue was raised by a fellow employee, and you need to help resolve it.

You are given an array A of n distinct integers that describe the raw data. You need to manipulate this array to obtain a new array S of n integers where S[i] = |{j : (1 ≤ j < i) ∧ (A[j] < A[i])}|.

For instance, if A = [10, 5, 12, 1, 11], then S = [0, 0, 2, 0, 3].

입력

The first line contains an integer n between 1 and 1,000,000.

The following n lines contain one integer per line where i+1th line describes A[i]. Assume |A[i]| ≤ 2,000,000,000.

출력

Your output should consist of n lines where ith line contains a single integer that describes S[i].

제한

예제 입력 1

5
10
5
12
1
11

예제 출력 1

0
0
2
0
3

힌트

출처

Contest > Startlink Online Contest > Startlink Online Contest #1 E2번

  • 문제를 만든 사람: haden
(追記) (追記ここまで)

출처

대학교 대회

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

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