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())
H = list(map(int,input().split()))
t = 0
h = 0
for i in H:
    if i >= h:
        t += 1
        h = i
print(t)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    H = [int(x) for x in input().split()]

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

    print(ans)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
count = 0
m = H[0]
for n in range(N-1):
    if H[n+1] - H[n] >= 0:
        if H[n+1] > m:
            count += 1
            m = H[n+1]
        elif H[n+1] == m:
            count += 1
print(count+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B - Great Ocean View
N = int(input())
H = list(map(int, input().split()))
count = 1
tmp = H[0]

for i in range(1,N):
    if tmp > H[i]:
        pass
    else:
        tmp = H[i]
        count += 1

print(count)

Submission status: Accepted

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

highest=0
count=0
for i in range(n):
      if h[i] >= highest:
            count += 1
            highest = h[i]
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = input()

h = map(int, raw_input().split())

tempMax = 0
ans = 0;
for i in h:
    if i >= tempMax:
        ans += 1
        tempMax = i

print ans

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

t = 0
ref = []

for i in range(n):
  ref.append(h[i])
  if h[i] == max(ref):
    t += 1
    
print(t)

Submission status: Accepted

Solution code:
n = int(input())
src = list(map(int, input().split()))
m = src[0]
count = 0
for s in src:
    if s >= m:
        count += 1
        m = s
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """4
6 5 6 8"""
        output = """3"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """5
4 5 3 5 4"""
        output = """3"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """5
9 5 6 8 4"""
        output = """1"""
        self.assertIO(input, output)


def resolve():
    N=int(input())
    A=[int(i) for i in input().split()]
    mx=0
    count=0
    for i in A:
        if mx<=i:
            count+=1
            mx=i
    print(count)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
def f_b():
    n, *h = map(int, open(0).read().split())
    c = n
    for i in range(1, n):
        for j in range(i):
            if h[j]>h[i]:
                c -= 1; break
    print(c)

if __name__ == "__main__":
    f_b()

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 1

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

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
h = [int(i) for i in input().split()]
maxi = 0
ans = 0
for i in range(n):
    if maxi <= h[i]:
        ans += 1
        maxi = h[i]
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 all(map(lambda x: x <= h[i], h[:i])):
        ans += 1

print(ans)

Submission status: Accepted

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

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 = 0
for i in range(len(h)):
  low = [num for num in h[0:i] if num > h[i]]
  if len(low) == 0:
    cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,len(h)):
  if h[i] ==max(h[:i+1]):
    cnt +=1
print(cnt)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    if n==1:
        print(1)
        return
    H=list(map(int,input().split()))
    M=[0]*n
    M[1]=H[0]
    for i in range(2,n):
        M[i]=max(M[i-1],H[i-1])
    print(sum(1 for i in range(n) if H[i]>=M[i]))
resolve()

Submission status: Accepted

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

count = 0
for i in range(N-1, 0, -1):
    icount = 0
    for j in range(0, i):
        if H[i] >= H[j]:
            icount += 1
        else:
            break
    if icount == i:
        count += 1

print(count+1)

Submission status: Accepted

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

tmp_max = 0
count = 0
for i in range(N):
    if h[i] >= tmp_max:
        tmp_max = h[i]
        count += 1
    else:
        pass
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
h = list(map(int, input().split()))
tmp_max = 0
count = 0
for hi in h:
    if tmp_max <= hi:
        tmp_max = hi
        count += 1
print(count)

Submission status: Accepted

Solution code:
num = int(input())

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

base = height[0]
heighest = height[0]
ans = 0
for i in height:
  if i>=heighest:
    ans += 1
    heighest = i
    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

max = H[0]
counter = 0

for i in H:
  if i >= max:
    max = i
    counter += 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
list1 = [int(k) for k in input().split()]
count = 1
for i, item in enumerate(list1):
    for j in range(0, i):
        if list1[j] > item:
            break
        if i - j == 1:
            count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
hhh = list(map(int, input().split()))
max_height = -1
ans = 0
for h in hhh:
    if h >= max_height:
        ans += 1
        max_height = h
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int, input().split()))
high = 0
cnt = 0
for i in arr:
    if high <= i:
        cnt +=  1
        high = i
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int, input().split()))
cnt = 0
for i, e in enumerate(lst):
    flag = True
    ci = 0
    while ci < i:
        if e < lst[ci]:
            flag = False
            break
        ci += 1
    ci = 0
    if flag:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lh = list(map(int, input().split()))
th = 0
count = 0

for i in range(n):
    if lh[i] >= th:
        th = lh[i]
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
temp_max = H[0]
for i in range(N):
    if temp_max <= H[i]:
        ans += 1
        temp_max = H[i]
        
print(ans)

Submission status: Accepted

Solution code:
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()))
ans = H[0]
count=0
for i in range(0,N):
  if ans <= H[i]:
    count+=1
    ans=H[i]
  else:
    continue
print(count)

Submission status: Accepted

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

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:
N = int(input())
H = list(map(int, input().split()))

res = 1
for i in range(1, N):
    if all(H[j] <= H[i] for j in range(0, i)):
        res += 1
print(res)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h=[int(i) for i in input().split()]
pre=[0]
for i in range(len(h)):
    pre.append(max(pre[-1],h[i]))
ans=0
for i in range(1,n+1):
    if(h[i-1]>=pre[i]):
        ans+=1
print(ans)

Submission status: Accepted

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

res = 1

for i in range(1, N):
    part_list = H[:i+1]
    tf_list = [H[i] < x for x in part_list]
    if sum(tf_list) == 0:
        res += 1

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

high = 0
cnt = 0

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

Submission status: Accepted

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

highest = 0
ans = 0

for i in range(N):
    if highest <= H[i]:
        highest = H[i]
        ans += 1

print(ans)

Submission status: Accepted

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

ans = 1
highest_hotel = Hotel_list[0]
for i in range(1, N):
    if Hotel_list[i] >= highest_hotel:
        ans += 1
        highest_hotel = Hotel_list[i]
    else:
        pass

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))
ans = 1
for i in range(N-1):
  if H[i+1] >= H[i]:
    ans += 1
  H[i+1] = max(H[i+1],H[i])
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:
x  = int(input())
lis = list(map(int,input().split()))
it = 0
count = 0
for i in range(len(lis)):
    for j in range(len(lis)-i):
   	    if lis[len(lis)-1-i]>=lis[len(lis)-1-j-i]:
   	        it = it + 1
   	    else:
   	        break
    if it==(len(lis)-i):
        count+=1
    it = 0    
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
List=list(map(int,input().split()))
count=1

for i in range(1,N):
    W=0
    for j in range(i):
        if List[j]>List[i]:
            W+=1
    if W==0:  
        count+=1
print(count)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
count=0
d=False

for i in range(N):
    if H[i] >= max(H[:i+1]):
        d=True
    else:
        d=False
            
    if d:
        count +=1
    
        
print(count)

Submission status: Accepted

Solution code:
n=int(input())

a=list(input().split())
total=1
for i in range(1,n):
  flag=0
  for k in range(i):
    if int(a[k])>int(a[i]):
      flag+=1
  if flag==0:
    total+=1
print(total)

Submission status: Accepted

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

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[:i])<=H[i]:
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans=1
for i in range(n-1):
    m=max(h[0:i+1])
    if h[i] <= h[i+1] and m <= h[i+1]:
        ans+=1

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
for i in range(1, N):
    cnt = 0
    for j in range(i):
        if H[j] <= H[i]:
            cnt += 1
    if cnt == i:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
h = Hs[0]
for i in range(N-1):
  if Hs[i+1] >= h:
    ans += 1
    h = Hs[i+1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
h = Hs[0]
for i in range(N-1):
  if Hs[i+1] >= h:
    ans += 1
    h = Hs[i+1]
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
mountains = list(map(int, input().split()))
highest = mountains[0]
counts = 1
for i in range(1, len(mountains)):
    if mountains[i] >= highest:
        counts += 1
        highest = mountains[i]
print(counts)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

max_h = []
for i in range(n):
    if i == 0:
        max_h.append(h[0])
    else:
        max_h.append(max(h[i],max_h[i-1]))
#print(max_h)

count = 0
for i in range(n):
    if h[i] >= max_h[i]:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

num = l[0]
ct = 1
for i in range(1,n):
    if l[i] >= num:
        ct +=1
    num = max(num,l[i])
    
print(ct)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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[:i])<=h[i]:
    ans+=1
print(ans)

Submission status: Accepted

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

max_value=H[0]

count=0
for h in H:
    if h>=max_value:
        count+=1
        max_value=h

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

max_height = H[0]
count = 1
for i in range(1, N):
    if max_height <= H[i]:
        max_height = 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 i in h:
    if i >= highest:
        highest = i
        cnt += 1
print(cnt)

Submission status: Accepted

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

counter=0
for i in range(N-1):
  if max(H[:(i+1)])==H[i]:
    counter+=1
    
if max(H)==H[N-1]:
  counter+=1
  
print(int(counter))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h = [int(_) for _ in input().split()]
hmax = 0
count = 0

for hi in h:
    if hmax <= hi:
        hmax = hi
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
hs = list(map(int, input().split()))
ms = [hs[0]]
for h in hs[1:]:
    m = ms[-1]
    if m >= h:
        ms.append(m)
    else:
        ms.append(h)
count = 0
for h, m in zip(hs, ms):
    if h >= m:
        count += 1
print(count)

Submission status: Accepted

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

c=0
m=0
for i in r:
  m=max(m,i)
  if m==i:c+=1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(cnt)


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 0
ans = 0
for h in H:
    if h >= tmp:
        ans += 1
        tmp = h

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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 h[i]>= max(h[:i]):
        count +=1


print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h = [int(e) for e in input().split()]
m = -1
result = 0
for i in h:
  if i >= m:
    result += 1
    m = i
print(result)

Submission status: Accepted

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

ans = 1
for i, h in enumerate(H[1:]):
    if h >= max(H[:i+1]):
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

max_high=0
count=0

for i in range(n):
    if H[i]>=max_high:
        count+=1
        max_high=H[i]
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
kage = 0

for i in range(n):
    if A[i] >= kage:
        ans += 1
    kage = max(kage, A[i])

print(ans)

Submission status: Accepted

Solution code:
def MAP(): return map(int,input().split())

n = int(input())
*h, = MAP()
ans=1
for i in range(1,n):
    flag = True
    for j in range(i-1,-1,-1):
        if h[j]>h[i]:
            flag=False
            break
    if flag:
        ans+=1

print(ans)

Submission status: Accepted

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

max_h = 0
cnt = 0
for n in range(N):
    if max_h <= H[n]:
        cnt += 1
        max_h = H[n]

print (cnt)

Submission status: Accepted

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

Submission status: Accepted

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