Submission
Status:
[PPPP][P][P][P][P]
Score: 100
User: akuyga1
Problemset: นก
Language: cpp
Time: 0.002 second
Submitted On: 2025-02-26 10:12:51
#include "bits/stdc++.h"
using namespace std;
#define ii pair<int,int>
#define f first
#define s second
#define mp make_pair
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin>>N;
vector<int> A(N+2);
A[0]=0; A[N+1]=0;
for(int i=1;i<=N;i++)cin>>A[i];
int c=0;
for(int i=1;i<=N;i++)if(A[i]>A[i-1]&&A[i]>A[i+1])c++;
cout<<c;
}