Submission
Status:
[PPPP][P][P][P][P]
Subtask/Task Score:
{20/20}{20/20}{20/20}{20/20}{20/20}
Score: 100
User: Theo
Problemset: นก
Language: cpp
Time: 0.004 second
Submitted On: 2026-09-21 08:54:17
#include <iostream>
int main(){
int a,b,c=0;
std::cin>>b;
int box[b];
for(int a=0;a<b;a++){
std::cin>>box[a];
}
for(int a=1;a<b-1;a++){
if(box[a]>box[a-1]&&box[a]>box[a+1]){
c=c+1;
}
}
if(box[0]>box[1]){
c=c+1;
}
if(box[b-1]>box[b-2]){
c=c+1;
}
if(b==1){
std::cout<<1;
}
else{
std::cout<<c;
}
}