Submission
Status:
[PPPP][P][P][P][P]
Score: 100
User: mister_o_hater_no1
Problemset: นก
Language: cpp
Time: 0.002 second
Submitted On: 2025-03-29 11:36:36
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin>> n;
int th[n+2], bn= 0;
th[0]= 0, th[n+ 1]= 0;
for(int i= 1; i<= n; ++i){
cin>> th[i];
}
for(int i= 1; i<= n; ++i){
if(th[i]> th[i- 1] && th[i]> th[i+ 1]){
bn++;
}
}
cout<< bn;
return 0;
}