#K67517. Count Rewards
Count Rewards
Count Rewards
You are given an integer n representing the number of days and a sequence of n integers where each integer represents the distance run on that day. Your task is to count the number of days on which the distance run is strictly greater than the distance run on the previous day.
More formally, let \( d_1, d_2, \dots, d_n \) be the distances. You need to compute the number of indices \( i \) (with \( 2 \le i \le n \)) such that \( d_i > d_{i-1} \).
Input and output method: Read input from standard input (stdin) and print the result to standard output (stdout).
inputFormat
The first line contains a single integer n (1 \( \le \) n \( \le \) 105), which denotes the number of days.
The second line contains n space-separated integers \( d_1, d_2, \dots, d_n \) where each \( d_i \) (0 \( \le \) \( d_i \) \( \le \) 109) represents the distance run on the ith day.
outputFormat
Print a single integer representing the number of rewards, where a reward is given each day that the distance run is strictly greater than the distance run on the previous day.
## sample5
1 2 3 2 4
3