Submission

Status:

[PPPP][P][P][P][P]

Subtask/Task Score:

{20/20}{20/20}{20/20}{20/20}{20/20}

Score: 100

User: NovemNotes

Problemset: นก

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-17 13:28:20

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int ans=0;
    int n;cin >> n;
    vector<int> v(n+2,0);
    for(int i=1;i<=n;i++)cin >> v[i];
    for(int i=1;i<=n;i++){
        if(v[i]>v[i-1]&&v[i]>v[i+1])ans++;
    }
    cout << ans << "\n";
    return 0;
}