포럼
문제 ICPC00274

A. Antenna Analysis

설명

Å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
출력
0 4 5 3 1
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NCPC 2021

평가 및 의견

A. Antenna Analysis

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

A. Antenna Analysis

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8