#383
Bronze II
Hoofball
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

In preparation for the upcoming hoofball tournament, Farmer John is drilling his NN cows (conveniently numbered 1N1\dots N, where 1N1001 \leq N \leq 100) in passing the ball. The cows are all standing along a very long line on one side of the barn, with cow ii standing xix_i units away from the barn (1xi10001 \leq x_i \leq 1000). Each cow is standing at a distinct location.

At the beginning of the drill, Farmer John will pass several balls to different cows. When cow ii receives a ball, either from Farmer John or from another cow, she will pass the ball to the cow nearest her (and if multiple cows are the same distance from her, she will pass the ball to the cow farthest to the left among these). So that all cows get at least a little bit of practice passing, Farmer John wants to make sure that every cow will hold a ball at least once. Help him figure out the minimum number of balls he needs to distribute initially to ensure this can happen, assuming he hands the balls to an appropriate initial set of cows.

입력

The first line of input contains NN. The second line contains NN space-separated integers, where the iith integer is xix_i.

출력

Please output the minimum number of balls Farmer John must initially pass to the cows, so that every cow can hold a ball at least once.

예제 입력 1

5
7 1 3 11 4

예제 출력 1

2
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Bronze II1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.