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

9848번 - Gift 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB69452050675.522%

문제

The coach of Jacqueline Yo, Olympic swimmer for Singapore, is concerned about her Butterfly stroke. He records her daily timing in milliseconds (a millisecond is onethousand of a second) and devises a scheme whereby each time she achieves a timing that is lower than the previous day’s timing by at least a certain number of milliseconds, he will reward her with a small encouragement gift.

Given a list of daily timings, determine how many gifts Jacqueline would have received.

입력

The first line contains 2 integers n and k, where n (3 ≤ n ≤ 100) is the number of days, and k (0 < k ≤ 100,000) the desired improvement (in milliseconds). Whenever Jacqueline’s timing reduces by at least k milliseconds over the previous day’s timing, she will receive a gift from her coach. The first line is then followed by n lines where each line contains a single integer t (0 < t ≤ 100,000) which is Jacqueline’s daily timing in milliseconds. The n timing records are listed in chronological order.

출력

The output consists of a single integer that indicates the number of gifts Jacqueline would have received.

제한

예제 입력 1

6 100
59420
59410
59310
59290
59470
59350

예제 출력 1

2

힌트

출처

Olympiad > National Olympiad in Informatics (Singapore) > NOI 2007 1번

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

출처

대학교 대회

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

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