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

23265번 - Antenna Analysis 다국어

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

문제

Åke has heard that there may be some suspicious 5G radiation in his city. To test this, he uses the antenna on his roof to measure the 5G level each day. However, he does not know how he should analyze the data.

We are given the measurements for $n$ consecutive days as a list of numbers $x_1, \ldots, x_n$ (where $x_i$ denotes the measurement for day $i$) and a constant $c$ that measures how much Åke expects the radiation to vary from day to day. We want to find, for each day $i,ドル the most significant difference between the measurement on day $i$ and any earlier day, after the expected variations are taken into account. More precisely, the goal is to find the maximum value of \[|x_i-x_j| - c \cdot |i-j|\] where $j \le i$. I.e., we want to find a large difference in 5G level that has happened recently.

입력

The first line of input contains the two integers $n$ and $c$ (1ドル \le n \le 4 \cdot 10^5,ドル 1ドル \le c \le 10^6$), the number of measurements and expected day-to-day variation. The second input line contains the $n$ integers $x_1,x_2,\dots,x_n$ (1ドル \le x_i \le 10^6$ for $i=1,2,\dots,n$), giving the measurements of the $n$ days.

출력

Output $n$ integers $y_1, \ldots, y_n,ドル where $y_i$ is the most significant difference on day $i$.

제한

예제 입력 1

5 1
2 7 1 5 4

예제 출력 1

0 4 5 3 1

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2021 A번

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

출처

대학교 대회

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

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