Submission

Status:

[PPPx][P][P][P][P]

Subtask/Task Score:

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

Score: 80

User: Dee

Problemset: นก

Language: python

Time: 0.015 second

Submitted On: 2026-11-15 14:37:48

n=int(input())
k = 0
count = 0
h=list(map(int,input().split()))
while k<n :
    if k==0:
        if (h[k])>(h[k+1]):
           count = count +1
    elif k== n-1:
        if (h[k])>(h[k-1]):
            count = count+1
    elif (h[k])>(h[k-1]) and (h[k])>(h[k+1]):
        count = count+1
    k=k+1
print(count)