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

33187번 - Cafebazaar’s Applications 다국어

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

문제

It’s the end of the year, and Cafebazaar has released a list, containing the number of users of each of its $n$ applications. Now, each application is eager to showcase its success through an advertisement image, which highlights a continuous subset of the application list containing the application itself. Also, for the image to be credible, it should contain at least $k$ applications, including itself.

For each application in this list, we need to determine the minimum possible rank this application can achieve within any valid subset, according to the number of users. The rank of an application within a subset is defined by the number of applications in that subset that have more users than it, plus one.

입력

The first line of input consists of two integers $n$ and $k$ (1ドル \le k \le n \le 10^5$), where $n$ represents the total number of applications and $k$ represents the minimum number of applications in an advertisement image. The following $n$ lines contain information about each application: the $i$th line contain $c_i,ドル representing the number of users for the $i$th application (1ドル \le c_i \le 10^8$).

출력

In the only line of output print $n$ space-separated integers. The $i$th integer should be the minimum rank that $i$th application can achieve within an advertisement image.

제한

예제 입력 1

7 3
15000000
10000000
30000000
20000000
200000
70000000
100000000

예제 출력 1

2 3 1 2 3 1 1

예제 입력 2

3 2
10
10
10

예제 출력 2

1 1 1

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > 2023 ICPC Asia Tehran Regional Contest J번

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

출처

대학교 대회

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

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