Submission

Status:

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

Subtask/Task Score:

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

Score: 100

User: Folk_DIWA

Problemset: นก

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-14 01:01:39

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

using ll = long long;

int main(){
    cin.tie(0)->sync_with_stdio(0);

    int n; cin >> n;
    int cnt = 0;

    vector <int> v ={0};
    for(int i=0; i<n; i++){
        int x; cin >> x;
        v.push_back(x);
    }v.push_back(0);

    for(int i=1; i<=n; i++){
        if(v[i] > v[i-1] and v[i] > v[i+1]) cnt++;
    }

    cout << cnt;

    return 0;
}