Problem E
Mountainpeeker

Joel has spent a lot more time climbing mountains than
programming the last 6 months, and he once again finds himself
on top of another mountain. This time he has climbed a very
special mountain range, where all the mountain tops are on a
single line. The mountain Joel has climbed is
Joel can see a mountain peak at
Input
The first line contains the integer
The second contains the integer
The following
Note that
Output
Print an integer: the number of other mountain tops Joel can see.
Scoring
Your solution will be tested on a set of test groups, each worth a number of points. Each test group contains a set of test cases. To get the points for a test group you need to solve all test cases in the test group.
Group |
Points |
Constraints |
|
|
|
|
|
|
|
|
|
|
|
No additional constraints. |
Explanation of Sample 1
The first peak at
Sample Input 1 | Sample Output 1 |
---|---|
2 7 1 7 2 7 |
1 |
Sample Input 2 | Sample Output 2 |
---|---|
3 0 3 4 1 1 4 3 |
2 |
Sample Input 3 | Sample Output 3 |
---|---|
2 0 1 1 -1 1 |
2 |
Sample Input 4 | Sample Output 4 |
---|---|
5 3 1 3 2 3 -1 3 -2 4 -3 2 |
3 |