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()))
count = 1
x =[h[0]]
for i in range(1,n):
  if max(x)<=h[i]:
    count += 1
    x.append(h[i])   

print(count)

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 = max(maxH,H[i])
print(cnt)

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def main():
	n = int(input())
	#b , c = tin()
	#s = input()
	#ret = max(b+c,b+b-1, c+c-1)
	#print(ret)
	al=lin()
	mh=al[0]
	ret=0
	for h in al:
		if mh <= h:
			ret += 1
			mh = h
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    if h[i] >= m:
        ans += 1
        m = max(m,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):
    for j in range(i):
        if H[j] > H[i]:
            break
    else:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
n = 0
ans = 1

for i in range(N-1):
  if H[i+1] >= H[n]:
    ans += 1
    n = 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):
    h = H[i]
    if h>=hmax:
        cnt += 1
        hmax = h
print(cnt)

Submission status: Accepted

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

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

ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
a = 0
for h in H:
    if a <= h:
        cnt += 1
        a = h
print(cnt)

Submission status: Accepted

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

M = 0
cnt = 0

for i in range(N):
  if M <= H[i]:
    M = 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):
  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()))

ans=1
for i in range(1,n):
    for j in range(i):
        can_see=True
        if h[i]<h[j]:
            can_see=False
            break
    if can_see: ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for h in H:
  if h >= M:
    ans+=1
    M = max(M,h)
    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
S = 0
m = 0
for h in H:
  if m<=h:
    S += 1
  m = max(m, h)
print(S)

Submission status: Accepted

Solution code:
input()
*l,=map(int,input().split())
print(1+sum(max(l[0:i])<=l[i]for i in range(1,len(l))))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    cur = h[0]
    ans = 1

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

    print(ans)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
n=int(input())
li=list(map(int,input().split()))
mx=0
ans=0
for i in li:
  if mx<=i:
    mx=i
    ans+=1
print(ans)

Submission status: Accepted

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

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

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

if not ( 1 <= N <= 20 ): sys.exit()
ceil = 0
count = 0
for I in array:
    if not ( 1 <= I <= 100 ): sys.exit()
    if I >= ceil: 
        ceil = I
        count += 1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
h = list(map(int, input().split()))
ans, peak = 0, 0
for i in h:
    if peak <= i:
        ans += 1
        peak = 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):
    out = False
    for j in range(i):
        if h[i] < h[j]:
            out = True
            break
    if not out:
        ans += 1

print(ans)

Submission status: Accepted

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

ans = 0
h_max = 0
for h_i in h:
    if h_max <= h_i:
        ans += 1
        h_max = h_i
print(ans)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
H = list(map(int, sys.stdin.readline().rsplit()))

maxi = 0
res = 0
for h in H:
    if maxi <= h:
        res += 1
        maxi = h

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

ans = 0
ma = h[0]
for i in h:
    if ma <= i:
        ans += 1
    ma = max(ma, i)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
min_h = 0

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

Submission status: Accepted

Solution code:
N = int(input())
H = [int(X) for X in input().split()]
MAX = H[0]
Count = 1
for T in range(1,N):
    if MAX<=H[T]:
        MAX = H[T]
        Count += 1
print(Count)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    H = list(map(int, input().split()))
    max_h = 0
    ans = 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:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

_ = ri()
li = rl()
cnt = 0
max_ = 0
for i in li:
  if i >= max_:
    cnt += 1
    max_ = i
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    H = il()

    ret, maxheight = 0, 0
    for h in H:
        if maxheight <= h:
            ret += 1
            maxheight = max(maxheight, h)
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque

n = int(input())
H = deque(map(int, input().split()))

ans = 0

h = 0

for i in range(n):
    h2 = H.popleft()
    if h2 >= h:
        ans += 1
    h = max(h, h2)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
hlist = list(map(int,input().split()))
kijun = hlist[0]
ans = 0
max = hlist[0]

for x in range(0,n):
  if hlist[x] >= max:
    max = hlist[x]
    ans+=1
  #print(hlist[x])
    
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
H=np.array(input().split(),dtype=np.int32)

H_cummax=np.maximum.accumulate(H)
print((H_cummax==H).sum())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))
Hmax=H[0]
cnt = 1

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

m = 0
c = 0
for h in H:
    if h >= m:
        c += 1
        m = h
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    h = list(map(int, input().split()))
    m = h[0]
    ans = 0
    for i in range(1,n):
        if h[i] >= m:
            ans += 1
            m = h[i]
    print(ans+1)
    return 0

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

for n in range(1,N):
  if max(H[:1+n])==H[n]:
    a+=1

print(a)

Submission status: Accepted

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

for n in range(N):
  if n!=0:
    T = max(H[:n])
  if T<=H[n]:
    a+=1

print(a)

Submission status: Accepted

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

for i in range(1, N):
    if H[i] >= h_max:
        ans += 1
        h_max = 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):
  ok = True
  for j in range(i):
    if h[j]<=h[i]:
      continue
    else:
      ok = False
      break
  if(ok):
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
  if max(H_hight[0:i+1]) == H_hight[i]:
    count += 1
    if i==0:
      continue

print(count-1)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)

n = int(input())
h = list(map(int, input().split()))
#n, m = map(int, input().split())
#s = input()
#s,t = input().split()
#a = [int(input()) for _ in range(n)]
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

ma = 0
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Great Ocean View
# https://atcoder.jp/contests/abc124/tasks/abc124_b
n = int(input())
h = list(map(int, input().split()))
c = 1
H = h[0]
for i in h[1:]:
    if i >= H:
        c += 1
    if H < i:
        H = i
print(c)

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int, input().split()))
max_ = 0
s = 0
for i in li:
  if max_ <= i:
    max_ = i
    s += 1
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    W = 0
    cnt = 0
    for i in range(len(A)):
        W = max(A[i],W)
        if W ==A[i]:
            cnt+=1

    print(cnt)




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    H = il()
    height, ret = 0, 0
    for h in H:
        if height <= h:
            height = h
            ret += 1
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()
 
n=ii()
h=lmi()
cnt=1
max_h=0
for i in range(n-1):
  max_h=max(max_h,h[i])
  if h[i]<=h[i+1] and h[i+1]>=max_h:
    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,1):
    muri = False
    for j in range(0,i,1):
        if H[i]<H[j]:
            muri = True
    if not muri:
        ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans=1
a=0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
hh = 0
for h in H:
  if hh <= h:
    ans += 1
    hh = h

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(x) for x in input().split()]
A = list(H)
for i in range(N):
  for j in range(i):
    if H[i] < H[j]:
      A[i] = 0
      break
print(len([i for i in A if i != 0]))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

ans = 0
res = h[0]

for i in h:
  if i >= res:
    ans += 1
    res = i
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
        continue
    if(max(h[0:i+1]) == h[i]):
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
max_height = 0
count = 0
for i in range(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())
h = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
n,m,c = int(raw_input()),-float('inf'), 0
for e in map(int, raw_input().split(' ')):
  c += 1 if m <= e else 0
  m = max(e, m)
print c

Submission status: Accepted

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




if __name__ == '__main__':
    solve()

Submission status: Accepted

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

x = 0
count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
ans=1
m=h[0]
for i in range(1,n):
  if h[i]>=m:
    ans+=1
    m=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):
  r=True
  for j in range(i):
    if h[i]<h[j]:
      r=False
  if r==True:
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, N):
    if all([H[i] >= j for j in H[:i]]):
        ans += 1

print(ans)

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

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int,input().split()))
high = h[0]
p = 1

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

print(p)

Submission status: Accepted

Solution code:
# coding: utf-8
N=int(input())
HList=list(map(int, input().split()))
MAX=0
ANS=0
for i in range(N):
    if HList[i]>=MAX:
        MAX=HList[i]
        ANS+=1
        
print(ANS)

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(input())
    h = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        tmp = h[: i + 1]
        if h[i] == max(tmp):
            ans += 1
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
h = list(map(int, input().split()))
ans = 0
for i in range(n):
    ans += h[i] >= max(h[:i+1])
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

a = ""
ans = N
for i in range(1, N):
    for j in range(0, i):
        if H[j] > H[i]:
            ans -= 1
            break
print(ans)

Submission status: Accepted

Solution code:
import sys


read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s_readline = sys.stdin.readline

N = int(readline())
H = list(map(int, readline().split()))


def solve():

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

    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

th = 0
ans = 0
for x in l:
  if x >= th:
    ans += 1
    th = x
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = input()
mountain_heights = [int(i) for i in input().split()]
height_count = 0
result = 0

for height in mountain_heights:
    if height >= height_count:
        height_count = height
        result += 1

print(result)

Submission status: Accepted

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

Submission status: Accepted

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