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

23372번 - Ice Growth 다국어

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

문제

Ice growth is dependent on temperature. A rule of thumb is that every 5ドル$ degrees of frost (on average in a 24ドル$-hour period) contributes to 1ドル$ cm of ice growth, whilst every 5ドル$ degrees above zero removes 1ドル$ cm of ice. For example, if there are three days with average temperatures of $-3,ドル 1ドル$ and $-7$ degrees Celsius there will be a total of 3ドル - 1 + 7 = 9$ degrees of frost and thus 1ドル.8$ cm of ice growth at the end of day 3ドル$. Of course, the ice thickness cannot be negative. If there is enough ice, people can skate on it. The required ice thickness depends on the person, as different persons have different perceptions of safety.

There is currently no ice, but the weather report for the next $n$ days has just come in, and a group of $k$ people wants you to figure out how many of these days they can skate on the ice at the end of the day.

입력

The input consists of:

  • One line containing two integers, $n$ (1ドル\leq n \leq 10^5$) the number of days and $k$ (1ドル \leq k \leq 10^5$) the number of people.
  • One line with $n$ integers $a_1, \ldots, a_n$ ($-10^6 \leq a_i \leq 10^6$ for all $i$), the average temperature on day $i$.
  • One line with $k$ integers $b_1, \ldots, b_k$ (1ドル \leq b_j \leq 10^6$ for all $j$), the required minimal ice thickness in cm before person $j$ can skate on the ice.

출력

Output a line with $k$ integers $c_1, \ldots, c_k,ドル where $c_j$ is the number of days that person $j$ can skate on the ice at the end of the day.

제한

예제 입력 1

3 2
-3 1 -7
1 2

예제 출력 1

1 0

예제 입력 2

5 3
-5 -5 15 -5 -5
1 2 3

예제 출력 2

4 2 0

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2021 Preliminaries I번

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

출처

대학교 대회

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

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