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

24241번 - Elder price robot 다국어

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

문제

The idea behind your latest business adventure, BarGain Overview (BGO), is to collect the history of prices for a certain item that is available for sale on the web. The BarGain score of a particular day is defined as the number of days since the price was lower or equal to today's price. The worst BarGain score is thus 1ドル,ドル and if the price is strictly better than all previous prices ever recorded, then it is infinity. You want to report the BarGain score to your customers to help them identify a good buy.

입력

The first line of input contains a single integer 2ドル \leq n \leq 400,000円,ドル the number of days for which you have collected price data for the item. On the second line of input follows $n$ space-separated integers $p_1, p_2, \ldots, p_{n},ドル where 0ドル \leq p_i \leq 10^6$ is the price of the item $i-1$ days ago. Today's price is $p_1$.

출력

Output $n$ rows, one for each day you have collected price data for the item. On the $i^{\text{th}}$ such line, output the BarGain score for the day that was $i-1$ days ago.

제한

예제 입력 1

6
9 10 11 9 12 11

예제 출력 1

3
2
1
infinity
1
infinity

힌트

출처

Contest > Bergen Open > Bergen Open 2021 E번

  • 문제를 만든 사람: Torstein Strømme
(追記) (追記ここまで)

출처

대학교 대회

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

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