Problem:


Score : 200 points

Problem Statement

There are N mountains ranging from east to west, and an ocean to the west.

At the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.

The height of the i-th mountain from the west is H_i.

You can certainly see the ocean from the inn at the top of the westmost mountain.

For the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \leq H_i, H_2 \leq H_i, ..., and H_{i-1} \leq H_i.

From how many of these N inns can you see the ocean?

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq H_i \leq 100

Input

Input is given from Standard Input in the following format:

N
H_1 H_2 ... H_N

Output

Print the number of inns from which you can see the ocean.

Sample Input 1

4
6 5 6 8

Sample Output 1

3

You can see the ocean from the first, third and fourth inns from the west.

Sample Input 2

5
4 5 3 5 4

Sample Output 2

3

Sample Input 3

5
9 5 6 8 4

Sample Output 3

1



Sample input:
4
6 5 6 8


Sample output:
3

Submission status: Accepted

Solution code:
n = int(input())
hi = list(map(int,input().split()))
mae = 0
count = 0
for i in hi:
  if i>=mae:
    count += 1
    mae = i
print(count)

Submission status: Accepted

Solution code:
#ABC124

n = int(input())
h = list(map(int,input().split()))
count = 0
for i in range(1,n+1):
    if  max(h[:i]) == h[:i][-1]:
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))

count = 0
for i in range(n):
    flag = True
    for j in range(i):
        if h[i] < h[j]:
            flag = False

    if flag:
        count += 1

print(count)

Submission status: Accepted

Solution code:
#import sys
#import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
N=int(input())
li= [int(x) for x in input().split()]
lar=li[0]
ans=1
for i in range(1,N):
  if li[i]>=lar:
    ans+=1
    lar=li[i]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
mx = h[0]
c = 1
for i in range(1,n):
  if mx <= h[i]:
    c += 1
    mx = h[i]
print(c)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split(" ")))

count = 0

for c in range(N):
    if c == 0:
        H_max = H[c]
        count += 1
    else:
        if H_max <= H[c]:
            H_max = H[c]
            count += 1
        else:
            pass

print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int,input().split()))


cnt=1 # h[0]
for i in range(1,n):
    flag=0
    for j in range(n):
        if i>j:
            # print(i,j,h[i],h[j])
            if h[i]>=h[j]:
                pass
            else:
                flag=1
    if flag == 0:
        cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = 0
now = A[0]
for i in A:
  if now <= i:
    ans += 1
    now = i
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))

highest = -float("inf")
ans = 0

for h in H:
    if highest <= h:
        highest = h
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H_li = list(map(int, input().split()))
Hmax = H_li[0]
ans = 1
for i in range(1, N) :
    if Hmax <= H_li[i] :
        ans += 1
        Hmax = H_li[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))

ans = 0
top = H[0]

for i in H:
  if i == top:
    ans += 1
  elif i > top:
    top = i
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
mx = h[0]
c = 1
for i in range(1,n):
  if mx <= h[i]:
    c += 1
    mx = h[i]
print(c)

Submission status: Accepted

Solution code:
N = int(input())
H_list = list(map(int, input().split()))
H_length = len(H_list)
ans_count = 0

for h_i in range(H_length):
    j_list = [j for j in range(h_i)]
    j_list = sorted(j_list, reverse=True)
    i_e = H_list[h_i]
    if len(j_list)==0:
        ans_count = ans_count + 1
        continue
    is_higher = True
    for h_j in j_list:
        if i_e<H_list[h_j]:
            is_higher = False
    if is_higher:
        ans_count = ans_count + 1

print(ans_count)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  Hs = list(map(int, input().split()))
  count = 1
  max= Hs[0]
  for i in range(1, n):
    if max <= Hs[i]:
      count += 1
      max = Hs[i]
  print(count)
  
if __name__=='__main__':
  main()

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))

ans = 0
max_height = 0
for h in H:
  if h >= max_height:
    ans += 1
  max_height = max(h, max_height)

print(ans)

Submission status: Accepted

Solution code:
N=input()
A=list(map(int,input().split()))
ans=0
for i in range(int(N)):
    B=0
    for j in range(i):
        if A[i]-A[j]>=0:
            B+=1
    if B==i:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
ans = 1
for i in range(1, n):
    # print(h[:i], h[i])
    if h[i] >= max(h[:i]):
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
ans = 1
for i in range(1, n):
  if max(h[0:i]) <= h[i]:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))

low = H[0]
count = 1

for i in range(1,N):
  if H[i] >= low:
    count += 1
    low = H[i]
    
print(count)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
ans=1
high=h[0]
for i in range(1,n):
    if h[i] >= high:
        ans+=1
        high=h[i]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=list(map(int,input().split()))
cnt=0
tmp=s[0]

for i in range(n):
            if s[i]>=tmp:
                        cnt+=1
                        tmp=s[i]
print(cnt)

Submission status: Accepted

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


n = int(input())
w = list(map(int, input().split()))
cnt = 0
for i in range(n):
    a = True
    for j in range(i):
        if w[j] > w[i]:
            a = False
            break
    if a:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))

_max = 0
cnt = 0
for i in H:
    if i >= _max:
       cnt += 1
       _max = i

print(cnt)

Submission status: Accepted

Solution code:
def main():

    N = int(input())

    H = [int(v) for v in input().split()]

    h = H[0]

    max_h = h

    count = 1
    for h in H[1:]:
        if h >= max_h:
            count += 1
        max_h = max(max_h, h)

    print(count)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
num=int(input()) 
montains=list(map(int,input().split()))

front=0
max=0
ans = 0
for high in montains:
  if high >= max:
    max = high
    if high >= front:
      ans +=1
  front=high

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h = list(map(int, input().split()))

ans=0
last=-1
for tmp in h:
        if last <= tmp:
                ans+=1
                last=tmp
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))

ans = N
for i in range(N):
    for j in H[:i]:
        if H[i] < j:
            ans -= 1
            break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

H = [int(i) for i in input().split()]

count = 1

for i in range(1,N):
  if max(H[:i+1]) == H[i]:
    count +=1
    
    
print(count)

Submission status: Accepted

Solution code:
N = int(input())
Height = list(map(int, input().split()))
ans = 1
h_w = Height[0]

for i in range(1, N):
    if (h_w <= Height[i]):
        ans += 1
    
    h_w = max(h_w, Height[i])

print(ans)

Submission status: Accepted

Solution code:
n,H = int(input()),list(map(int,input().split()))

h = H[0]
ans = 1
for i in range(1,n):
    if h <= H[i]:
        h = H[i]
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int,input().split()))
c = 0

for i in range(n):
    if h[i] == max(h[:i+1]):
        c += 1

print(c)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))

ans = 0
max_H = 0

for i in range(N):
    if H[i] >= max_H:
        ans += 1
        max_H = H[i]
        
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
H = [int(x) for x in input().split()]

ans = 0
maxH = 0
for i in range(N) :
    if H[i] >= maxH :
        ans += 1
    maxH = max(maxH, H[i])

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))

count = 1
for i in range(1, n):
    if max(h[:i]) <= h[i]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
#124_B
N=int(input())
H=list(map(int,input().split()))

max_h=0
cnt=0
for i in range(N):
    if H[i]>=max_h:
        cnt+=1
        max_h=H[i]
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
Hs = list(map(int, input().split()))
m = -50
cnt = 0

for i in range(n):
    if Hs[i] >= m:
        m = Hs[i]
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
H = list(map(int, input().split()))
c = 1
m = H[0]
for i in range(1, n):
  if m <= H[i]:
    c += 1
    m = H[i]
print(c)

Submission status: Accepted

Solution code:
_,t=open(0);m=a=0
for h in map(int,t.split()):a+=h>=m;m=max(m,h)
print(a)

Submission status: Accepted

Solution code:
_, *hs = map(int, open(0).read().split())
cou=1
hm=hs[0]
for h in hs[1:]:
  if hm<=h:
    cou+=1
    hm=h
print(cou)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
m,count=0,0
for i in range(n):
  m=max(m,h[i])
  if h[i]==m:
    count+=1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
H = list(map(int, input().split()))

ans = 1
max_h = H[0]
for i in range(1, n):
    if H[i] >= max_h:
        ans += 1
    max_h = max(max_h, H[i])
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
ans=1
if n==1:
    print(ans)
else:
    h0=h[0]
    for i in range(1,n):
        if h[i]>=h0:
            ans+=1
            h0=h[i]
    print(ans)

Submission status: Accepted

Solution code:
n=int(input())

t = list(map(int,input().split()))

count = 0
mmax = 0

for i in t:
    if mmax <= i:
        mmax = i
        count += 1
print(count)

Submission status: Accepted

Solution code:
N = input()
H = list(map(int, input().split()))

ans = 0
h0 = 0
for h in H:
    if h >= h0 and h >= H[0]:
        ans += 1
        h0 = h
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))
ans = 0
for i in range(N):
    if H[i] == max(H[:i+1]):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
print(sum(max(h[:i]+[0])<=h[i]for i in range(n)))

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))

cnt = 0
max = 0
for i in range(N):
    if H[i] >= max:
        max = H[i]
        cnt += 1
    else:
        max = max
        cnt = cnt

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

H = [int(i) for i in input().split()]

count =0

for i in range(N):
    if i ==0:
        count+=1
        H_max_so_far = H[i]
    else:
        if H[i] >= H_max_so_far:
            count+=1
            H_max_so_far = H[i]
            
print(count)

Submission status: Accepted

Solution code:
#ABC-124-B
N = int(input())
H = list(map(int, input().split()))
ans = 1

for i in reversed(range(1, N)):
    flag = True
    for j in reversed(range(i)):
        if H[j] > H[i]:
            flag = False
            break
    if flag == True:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
c = 1
s = []
for i in range(1, n):
    s = max(l[:i])
    if l[i] >= s:
        c += 1
print(c)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))

max=0
cnt=0
for i in range(N):
    if H[i]>=max:
        cnt+=1
        max=H[i]
print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
h=list(map(int,input().split()))
cnt=1
i=1
while i<N:
    if h[i]>=max(h[:i]):
        cnt+=1
    i+=1
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
max=h[0]
c=0
for i in range(n):
  if h[i]>=max:
    c+=1
    max=h[i]
print(c)

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
tmp=0
ans=0
for i in range (N):
	if tmp<=L[i]:
		tmp=L[i]
		ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.buffer.readline
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getlist():
    return list(map(int, input().split()))
import math
import heapq
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15

def main():
    n = getN()
    nums = getlist()
    hst = 0
    ans = 0
    for num in nums:
        if num >= hst:
            ans += 1
        hst = max(hst, num)

    print(ans)
if __name__ == '__main__':
    main()

"""
9999
3

2916
"""

Submission status: Accepted

Solution code:
import sys

inputs = [row.split() for row in sys.stdin.readlines()]

mount_list = inputs[1]
mount_list = [int(height) for height in mount_list]

result_cnt = 0
old_max_height = mount_list[0]
for height in mount_list:
    if old_max_height <= height:
        result_cnt+=1
        old_max_height = max(old_max_height, height)
print(result_cnt)

Submission status: Accepted

Solution code:
import sys

inputs = [row.split() for row in sys.stdin.readlines()]

mount_list = inputs[1]
mount_list = [int(height) for height in mount_list]

result_cnt = 0
old_max_height = mount_list[0]
for height in mount_list:
    new_max_height = max(old_max_height, height)
    if old_max_height < new_max_height:
        result_cnt+=1
        old_max_height = new_max_height
    elif old_max_height == height:
        result_cnt+=1    
print(result_cnt)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int,input().split()))
flag = 1
cnt = 0
for i in range(n):
    for j in range(i+1):
        if h[i]>=h[j]:
            flag = 1
        else:
            flag = 0
            break
    if flag == 1:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
count=1
for i in range(1,N):
    if max(H[0:i+1])==H[i]:
        count+=1
print(count)

Submission status: Accepted

Solution code:
import sys
n = int(input())
h = list(map(int,input().split()))
cnt = 0
state = 1
for i in range(n):
    for j in range(i+1):
        if h[i]<h[j]:
            state = 0
            break
        else:
            state = 1
    if state == 1:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
*H, = map(int, input().split())

ans = 0
for i in range(N):
    canSee = True
    for j in range(0, i):
        if not H[j]<=H[i]:
            canSee = False
            break
    ans += canSee
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
H = list(map(int, input().split()))

answer = 0
for i in range(n):
    if H[i] == max(H[:i + 1]):
        answer += 1

print(answer)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
TOLL=H[0]
p=1
for i in range(1,N):
  if H[i]>=TOLL:
    p+=1
    TOLL=H[i]
print(p)

Submission status: Accepted

Solution code:
n=int(input())
b=c=0
for h in map(int,input().split()):
  if b<=h:
    b=h
    c+=1
print(c)

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
tmp=l[0]
count=0
for i in range(n):
  if l[i]>=tmp:
    count+=1
    tmp=l[i]
print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = [int(i) for i in input().split()]
mx = h[0]
count = 1
for i in range(1,n):
    if mx <= h[i]:
        count += 1
        mx = h[i]
print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))

ans = 1
o = h[0]
for i in range(1, len(h)):
    o = max(o, h[i])
    if h[i] >= o:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
a=[h[0]]
for i in range(1,n):
    if a[-1]<=h[i]:
        a.append(h[i])

print(len(a))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# https://atcoder.jp/contests/abc124/tasks/abc124_b

n = int(input())
h = [0] + [int(x) for x in input().split()]
cnt = 0
for i in range(1, len(h)):
    if len([j - h[i] for j in h[:i + 1] if j - h[i] > 0]) == 0:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
h=[int(x) for x in input().split()]
count=1
max=h[0]
for i in range(n-1):
    if max <= h[i+1]:
        max=h[i+1]
        count+=1
print(count)

Submission status: Accepted

Solution code:
def main(n,h):
    count = 1
    height = h[0]
    for i in range(1,len(h)):
        if height <= h[i]:
            count += 1
        height = max(height, h[i])
    print(count)

def resolve():
    n = int(input())
    h = list(map(int, input().split()))
    main(n,h)

resolve()

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    h = list(map(int, input().split()))
    count = 1
    height = h[0]
    for i in range(1,len(h)):
        if height <= h[i]:
            count += 1
        height = max(height, h[i])
    print(count)

resolve()

Submission status: Accepted

Solution code:
N=int(input())
H = list(map(int,input().split()))
ans=0
for i in range(N):
    if max(H[0:i+1])<=H[i]:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
yama = list(map(int, input().split()))
nishi = yama.pop(0)
ans = 1
for i in yama:
    if i >= nishi:
        nishi = i
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    N = int(input())
    H = list(map(int, input().split()))
    result = H[0]
    count = 0
    for h in H:
        if result <= h:
            count += 1
            result = h
    print(count)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))

l = [h[0]]
for i in range(1, n):
    if l[-1] <= h[i]:
        l.append(h[i])
        
print(len(l))

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
m=0
c=0
for x in a:
    if m<=x:c+=1
    m=max(m,x)
print(c)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
s=1
for i in range(1,N):
  if H[i]>=max(H[0:i]):
    s+=1
print(s)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
ans=0
for i in range(N):
  if i==0:
    ans+=1
  else:
    for j in range(i):
      if H[j]<=H[i]:
        continue
      else:
        break
    else:
      ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h_list = list(map(int,input().split()))
count = 0
for i in range(n):
    if max(h_list[:i+1]) == h_list[i]:
        count+= 1
print(count)

Submission status: Accepted

Solution code:
n=int(input())
h=[int(e) for e in input().split()]
ans=1
for i in range(1,n):
    if max(h[:i]) <= h[i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
ans = 0
for i in range(n):
    if h[i] == max(h[:i + 1]):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int,input().split()))
ans = 0
for i in range(n):
    flag = 0
    for j in range(i):
        if h[i]<h[j]:
            flag = 1
    if flag==0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))

cnt=0

for i in range(n):
    if max(h[:i+1]) == h[i]:
        cnt+=1
    else:
        continue

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))
counter = 1
for i in range(1,N):
  bool = True
  for j in range(0,i):
    if H[j] > H[i]:
      bool = False
  if bool:
    counter += 1
print(counter)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    num_list = list(map(int, input().split()))

    ans = 1

    tmp = num_list[0]

    for i in range(1,n):
        if tmp <= num_list[i]:
            ans += 1
            tmp = num_list[i]

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#124
n = int(input())
h = list(map(int, input().split()))

res = 0
for i in range(n):
    jud = 1==1
    for j in range(0,i):
        if h[i] < h[j]:
            jud = 1==0
            break
    if jud:
        res += 1
print(res)

Submission status: Accepted

Solution code:
n = int(input())
h = [int(x) for x in input().split()]

ans = 0
tmp = 0
for i in range(n):
    if max(tmp, h[i]) == h[i]:
        ans += 1
        tmp = h[i]

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
l = list(map(int, input().split()))
min = 0
cnt = 0
for i in range(a):
  if min <= l[i]:
    cnt += 1
    min = l[i]
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

t = a[0]
ans = 0
for i in range(n):
    if t > a[i]:
        continue
    else:
        t = a[i]
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
*H, = map(int, input().split())
ans = 1
for i in range(1, N):
    if max(H[:i]) <= H[i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))

cnt = 1
max = h[0]
for i in range(1,n):
    if h[i] >= max:
        max = h[i]
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))

cnt = 1
maximum = h[0]

for i in range(1, n):
    if(maximum <= h[i]):
        maximum = h[i]
        cnt += 1
        
print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))

X=1
for i in range(1,N):
    if max(H[:i])<=H[i]:
        X+=1

print(X)

Submission status: Accepted

Solution code:
s = int(input())
l = list(map(int,input().split()))
ans = 1
x = l[0]
for i in range(s-1):
    if l[i] <= l[i+1] and x <=l[i+1]:
        ans += 1
        x = l[i+1]
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
n=int(input())
h=np.array(list(map(int,input().split())))
answer=0
for i in range(n):
  if np.all(h[:i] <= h[i]):
    answer+=1
print(answer)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=1
H=A[0]
for i in range(1,N):
    if H<=A[i]:
        ans+=1
        H=A[i]
print(ans)

Submission status: Accepted

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    H = LIST()

    cnt = 1
    for i in range(N-1):
        if H[i+1] >= H[i]: cnt += 1
        else: H[i+1] = H[i]

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
H=[int(i) for i in input().split()]

cnt=0
for i in range(n):
  flag=True
  for j in range(i):
    if H[j]>H[i]:
      flag=False
      break
  if flag:
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
count = 0
for i in range(N):
  l = sorted(H[:i + 1])
  if l[-1] <= H[i]:
    count += 1
print(count)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
cnt=0
highest=0
for h in H:
    if h>=highest:
        highest=h
        cnt+=1
            
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(i) for i in input().split()]

base = H[0]
cnt = []
for idx in range(N):
    key = H[idx]
    if base <= key:
        cnt.append(key)
        base = key
print(len(cnt))

Submission status: Accepted

Solution code:
n = int(input())
height = tuple(map(int, input().split()))
ans = 1
mt_max = height[0]
for i in range(1, n):
    if mt_max <= height[i]:
        ans += 1
        mt_max = height[i]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))
min0 = v[0]
cnt = 0
for i in range(n):
    if v[i] >= min0:
        cnt += 1
        min0 = v[i]
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
H = list(map(int, input().split()))

ans = 1
base_h = H[0]

for i in range(1, n):
  if H[i]>=base_h:
    ans += 1
    base_h = H[i]
    
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = [int(x) for x in input().split()]

ans = 1
high = h[0]
for i in range(1, n):
    if h[i] >= high:
        ans += 1
        high = h[i]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))

maximum = -1 
count = 0
for i in l:
  if i > maximum:
    maximum = i
  if i == maximum:
    count += 1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))

ans=0
mh=h[0]
for i in h:
  if i >= mh:
    mh = i
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
high = h[0]
cnt = 0
for i in range(n):
    if h[i] >= high:
        cnt += 1
        high = h[i]
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
h=list(int(x) for x in input().split())
cnt=1
for i  in range(1,n):
	if all(h[i]  >= h[j] for j in range(0,i)):
		cnt +=1
	else:
		continue
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
high = -float("inf")
x = 0
for i in range(n):
     if h[i] >= high:
          high = h[i]
          x += 1
print(x)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
high = 0
for a in A:
  if high <= a:
    ans += 1
    high = a
print(ans)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    H = tuple(map(int, input().split()))

    ans = 0
    max_h = 0
    for h in H:
        if h >= max_h:
            ans += 1
            max_h = h
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))

flag = True
ans = 1
for i in range(n-1, 0, -1):
  a = h[0:i]
  if h[i] >= max(a):
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
_ = int(input())
h_list = list(map(int, input().split()))
max = 0
count = 0

for h in h_list:
    if h >= max:
        max = h
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
maxNum, ans = 0, 0
for i in range(len(H)):
    maxNum = max(maxNum, H[i])
    if (H[i] == maxNum): ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h=[int(x) for x in input().split()]

max_h=h[0]

ans=1

for i in range(1,len(h)):
    if h[i] >= max_h:
        ans+=1
        max_h=h[i]

print(ans)

Submission status: Accepted

Solution code:
#124 b
n=int(input())
h=list(map(int,input().split()))
ans=1
for i in range(1,n):
    best=h[i]
    for j in range(i):
        if best<h[j]:
            best=h[j]
    if best==h[i]:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(i) for i in input().split()]
curr = H[0]
count = 1
for i in range(1, N):
    if curr <= H[i]:
        curr = H[i]
        count = count + 1

print(count)

Submission status: Accepted

Solution code:
N, *H = map(int, open(0).read().split())
c = 1
for i, h in enumerate(H):
    b = []
    for j in range(i):
        if H[j] <= h:
            b.append(True)
        else:
            b.append(False)
    
    if not len(b) == 0 and all(b):
        c += 1

print(c)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))

ans = 0
p = H[0]
for h in H:
    if p <= h:
        ans += 1
        p = h
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))

count = 1
max_height = H[0]
for i in range(1, N):
    if max_height <= H[i]:
        count += 1
    max_height = max(max_height, H[i])
print(count)

Submission status: Accepted

Solution code:
n=int(input())
hl=list(map(int,input().split()))
mx=0
mxh=[]
ans=1
for i in range(n):
    mx=max(mx,hl[i])
    mxh.append(mx)
for i in range(1,n):
    if hl[i]>=mxh[i-1]:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
count=1
high=H[0]
for i in range(1,len(H)):
    if high<=H[i]:
        high=H[i]
        count+=1
print(count)

Submission status: Accepted

Solution code:
n=int(input())
A=list(map(int,input().split()))
m=A[0]
ans=int(1)
for i in range(1,n):
    if m<=A[i]:
        ans+=1
        m=A[i]
print(ans)

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin

mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n = ni()
a = na()

m = 0
ans = 0
for i in range(n):
    m = max(m, a[i])
    if a[i] >= m:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
H=list(map(int,input().split()))
cnt=0; m=0
for i in range(0,n):
    if H[i]>=m:
        m=max(H[i],m)
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
c=sum(max(h[:i])<=h[i] for i in range(1,n))+1
print(c)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
flag=1
count=0
for i in range(N):
    for j in range(i):
        if H[j]>H[i]:
            flag=0
            break
        else:
            flag=1
    if flag==1:
        count=count+1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
Hlist = list(map(int, input().split()))
ans = 0
max_h = 0
for H in Hlist:
    if H >= max_h:
        ans += 1
    max_h = max(H, max_h)
print(ans)

Submission status: Accepted

Solution code:
n = int (input())
h = list(map(int,input().split()))
max_num = 0
ans = 0
for i in range (n):
  if h[i] >= max_num:
    max_num = h[i]
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int,input().split()))
count = 0
maxh = 0
for i in h:
    if maxh <= i:
        maxh = i
        count += 1
print(count)