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:
#B - Great Ocean View
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N):
    isOk = True
    if i != 0:
        for j in range(i):
            if H[i] < H[j]:
                isOk = False
    if isOk:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# print(hs)
max = 0
ans = 0
for i in range(n):
    if hs[i] >= max:
        ans +=1
        max = hs[i]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
print(len(list(filter(lambda b:b==True, list([max(h[:i+1]) <=hi for i, hi in enumerate(h)])))))

Submission status: Accepted

Solution code:
N = int(input())

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

mount = 0
cnt = 0

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

Submission status: Accepted

Solution code:
N = int(input())
H = [int(i) for i in input().split()]
m = 0
b = 0
for a in H:
  if b <= a:
    m += 1
  b = max(b,a)
print(m)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = input()
N = int(N)

a = list(map(int, input().split()))
a.reverse()

i = 0
while i < N:
    b = max(a)
    c = a.index(b)
    d = a[c+1:]

    i += 1
    if d == []:
        break
    a = d

print(i)

Submission status: Accepted

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

for j in range(n):
  if t[0] <= t[j]:
    ans += 1
    t[0] = t[j]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
h = list(map(int, input().split()))
count = 1


for i in range(1, len(h)):
    for m in range(0,i):
        if h[i] < h[m]:
            break
        if m == i - 1:
            count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,*H = map(int, open(0).read().split())
#print(H)
L = 0

for i in range(N):
    if i == 0:
        L+=1
    elif max(H[0:i]) <= H[i]:
        L+=1
print(L)

Submission status: Accepted

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

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

Submission status: Accepted

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

M = H[0]
i = 0

for h in H:
  if h >= M:
    M = h
    i += 1

print(i)

Submission status: Accepted

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

# 整数の入力
n = int(input())
# スペース区切りの整数の入力
h = list(map(int, input().split()))

baseHeight = h[0]
canViewCnt = 1

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

# 出力
print(str(canViewCnt))

Submission status: Accepted

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

ans = 1
for idx, i in enumerate(h[1:]):
    f = True
    for j in h[:idx+2]:
        if i < j:
            f = False
            break
    if f:
        ans += 1

print(ans)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
a = int(input())
b = [int(i) for i in input().split()]

numbers = 1
for i in range(1, len(b)):
    if b[i] >= max(b[0:i]):
        numbers += 1

print(numbers)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

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

Submission status: Accepted

Solution code:
N = int(input())
h_vals = input().split(' ')
h_vals = [int(h) for h in h_vals]
hmax = -1
count = 0
for h in h_vals:
  if hmax <= h:
  	hmax = h
  	count+=1
print(count)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(i) for i in 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())
Max = 0
ans = 0
for i in map(int, input().split()):
    if i >= Max:
        Max = i
        ans += 1

print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(visible_hotels)

Submission status: Accepted

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

yado = [0]*(n+1)

for i,n in enumerate(h):
    if max(h[:i+1]) == h[i]:
        yado[i]=1

print(sum(yado))

Submission status: Accepted

Solution code:
N=int(input())
H=[int(x) for x in input().split()]
can_watch = 0
for i in range(N):
  if i > 0:
    if H[i] >= max(H[:i]):
      can_watch = can_watch + 1
    else:
      pass
  else:
    can_watch = can_watch + 1
print(can_watch)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
check_num = a[0]
answer = 0
for i in range(N):
    if check_num <= a[i]:
        check_num = a[i]
        answer += 1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = [int(x) for x in input().split()]
max_h = l[0]
result = 1
for i in range(1,n):
    if max_h <= l[i]:
        result += 1
        max_h = l[i]
    else:
        continue
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
y = int(input())
l = list(map(int, input().split()))
for i in range(len(l)):
    for item in l[:i]:
        if item > l[i]:
            y -= 1
            break

print(y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
mountains = [int(_) for _ in input().split()]

curr = 0
tot = 0
for i in mountains:
  if i >= curr:
    tot += 1
    curr = i

print(tot)

Submission status: Accepted

Solution code:
n = int(input())

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

min = 0
cnt = 0

for i in a:
  if min <= i:
    min = i
    cnt += 1

print(cnt)

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())
inputs = list(map(int, input().split(" ")))
p = 1
i = 2
for x in inputs[1:]:
    Max = max(inputs[0:i])
    p = p + 1 if x == Max else p
    i=i+1
print(p)

Submission status: Accepted

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

for i in range(1,n):
    for j in range(i):
        if h[i] < h[j]:
            ans -= 1
            break

print(ans)

Submission status: Accepted

Solution code:
N = input()

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

max = 0
count = 0
for i in H:
    if max <= int(i):
        max = int(i)
        count = count + 1

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import math, itertools, operator
from math import *
from math import factorial as fact
from functools import reduce
from statistics import mean, median, median_low, median_high, mode
# Before Python 3.5
from fractions import gcd
#import numpy
#import scipy, scipy.special
#from sympy import isprime, nextprime
#from sympy.ntheory import factorint

inf = float('inf')

def lcm(a, b):
    return a * b // gcd(a,b)

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))

################################################################################

N = input_ints()
H = input_ints()

curmax = -inf
cnt = 0
for Hi in H:
    if curmax <= Hi:
        cnt += 1
        curmax = Hi
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

c = 0
maxh = -1
for i in range(N):
    if maxh <= H[i]:
        c += 1
        maxh = H[i]
print(c)

Submission status: Accepted

Solution code:
num = int(input())
ms = list(map(int, input().split()))
m_max = 0
total = 0
for i in ms:
    if i >= m_max:
        total += 1
        m_max = i
print(total)

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:
N = int(input())
a = list(map(int, input().split()))
cnt = 0
max = 0
for i in range(N):
    if max <= a[i]:
        cnt += 1
        max = a[i]
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str=input();
mountains=input().split(" ");
higher=0;
num=0;
for mountain in mountains:
  if higher<=int(mountain):
    num+=1;
    higher=int(mountain);

print(num);

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())

H_list_str = input().split()
H_list_int = list(map(int,H_list_str))

H_Count = 1

for i in range(1,N):
    for j in range(N-1):
        if H_list_int[i] < H_list_int[j]:
            break
        else:
            if j == i-1:
                H_Count += 1
            else:
                continue

print(H_Count)

Submission status: Accepted

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


ans = 0
judge = True
for i in range(n):
    judge = True
    for j in range(i):
        if h[j] > h[i]:
            judge = False
            break
    if judge:
        ans += 1
print(ans)

Submission status: Accepted

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

h_max = 0
cnt = 0
for h in h_list:
    if h >= h_max:
        h_max = h
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
hs = list(map(int, input().split()))
c = 0
for i in range(0, len(hs)):
    b = 1
    for j in range(0, i):
        if hs[j] > hs[i]:
            b = 0
    if b == 1:
        c += 1
print(c)

Submission status: Accepted

Solution code:
num_hotels = int(input())
num_oceanview_hotel = 1
mountains = list(map(int,input().split()))
max_mountain = mountains[0]

for i in range(1, num_hotels):
    if mountains[i] >= max_mountain:
        max_mountain = mountains[i]  
        num_oceanview_hotel += 1
        
print(num_oceanview_hotel)

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
r = m = 0
for a in l:
    if m <= a:
        r += 1
        m = a
print(r)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(i) for i in input().split()]
#print(N,H)
cnt = 0
hmax = 0
for h in H:
  if hmax <= h:
    cnt += 1
    hmax = h
print(cnt)

Submission status: Accepted

Solution code:
A = int(input())
l =[int(i) for i in input().split()]
ans = 0
 
for t in range(1,A+1):
    tt = int(t)
    if l[tt-1] == max(l[:tt]):
        ans += 1
    
print(ans)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
Hlist = input().split()
nlist = []
for t in Hlist:
    nlist.append(int(t))
k = nlist[0]
maxlist = [nlist[0]]
p = 1
for t in range(1,len(nlist)):
    if nlist[t] >= max(maxlist):
        p+=1
        maxlist.append(nlist[t])
    else:
        maxlist.append(nlist[t])
print(p)

Submission status: Accepted

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

cnt = 0
max_s = 0

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

	max_s = max(s[i],max_s)

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

print(counter)

Submission status: Accepted

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

for i in range(1, N):
	for j in range(0, i):
		if H_list[i] < H_list[j]:
			sub += 1
			break
			
print(N - sub)

Submission status: Accepted

Solution code:
def solve(n, h):
    threshold = 0
    res = 0
    for i in range(n):
        if threshold <= h[i]:
            res += 1
        threshold = max(threshold, h[i])
    return res

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

Submission status: Accepted

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

cur_max_h = H[0]
ans = 0

for i in range(len(H)):
    if cur_max_h <= H[i]:
        ans += 1
        cur_max_h = H[i]
print(ans)

Submission status: Accepted

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

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

print(c)

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=h
print(ans)

Submission status: Accepted

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

ans=0
h=H_list[0]

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))
maxhigh = H[0]
answer = 0

for x in H:
    if maxhigh <= x:
        answer += 1
        maxhigh = x

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline())
matlist = list([int(i) for i in sys.stdin.readline().split()])

bef = 0
ans = 0
for i in range(n):
    tmp = matlist[i]
    if tmp >= bef:
        ans += 1
        bef = tmp

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#a,b=map(int,input().split())
a = int(input())
b=input()
b = b.split()
b = [int(i) for i in b]
kazu = 1
for i in range(0,a-1):
    c= [b[i] for i in range(0,i+1)]
    if b[i+1]>=max(c):
        kazu +=1
print(kazu)

Submission status: Accepted

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

ans = 0
current_max = 0
for i in range(N):
    current_max = max(current_max, H_list[i])

    if H_list[i] >= current_max:
        ans = ans + 1

print(ans)

Submission status: Accepted

Solution code:
mon = int(input())
top = 0
ocean = 0
hight = list(map(int, input().split()))
for i in range(mon):
    if hight[i] >= top:
        ocean+=1
        top = hight[i]
print(ocean)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
h = input()
h = h.split(" ")
h = [int(x) for x in h]
max = 0
counter = 0
for _, i in enumerate(h):
  if i >= max:
    counter += 1
    max = i
print(counter)

Submission status: Accepted

Solution code:
import sys

N = int(input())
line = list(map(int,input().split()))

ans = 1
mx = line[0]


for i in range(1,line.index(max(line))):
	if line[i] >= mx:
		ans += 1
		mx = line[i]

for i in range(line.index(max(line)),len(line)):
	if i != 0 and line[i] == max(line):
		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(1, n):
    if h[i] >= m:
        ans += 1
        m = h[i]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

N = int(input())
H = [int(x) for x in 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())
l=list(map(int, input().split()))
m=0
for i in range(n):
  for j in range(i):
    if l[j]>l[i]:
      break
  else:
    m+=1
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = [int(x) for x in input().split()]
count = 0
for i in range(N):
  for j in range(i):
    if H[i] < H[j]:
      break
  else:
      count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
m=0
ans=0
for i in input().split():
    if int(i)>=m:
        ans+=1
        m=int(i)

print(ans)

Submission status: Accepted

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

max_h = 0
ans = 0
for height in Hs:
  if height >= max_h:
    ans += 1
    max_h = max(max_h, height)
  else: continue

print(ans)

Submission status: Accepted

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

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h_ary = [int(s) for s in input().split(' ')]

num = 0

for i, h in enumerate(h_ary):
    if max(h_ary[:i+1]) <= h:
        num += 1

print(num)

Submission status: Accepted

Solution code:
import sys

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    H = list(map(lambda x: int(x), sys.stdin.readline().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:
n = int(input())

highest = 0
ans = 0

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

for h in x:
  if h >= highest:
    ans += 1
    highest = h
    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
maxH = H[0]
S = []
for i in H:
    if i >= maxH:
        S.append(i)
        maxH = i
print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
n = input().rstrip().split(' ')
H = [int(i) for i in n]
c = 1
s = [0]*N
s[0] = H[0]
for i in range(1,N):
  if max(s)<= H[i] :
    c +=1
    s[i] = H[i]
  else:
    pass
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(n):
  viewable = False
  for j in range(i):
    if h[j] > h[i]:
      break
    elif j == i - 1:
      viewable = True
      
  if viewable == True:
    result += 1

print("{}".format(result))

Submission status: Accepted

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

max = h[0]
count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
x = 0
 
h_max=h[0]

for i in range(n):
  if h[i] >= h_max:
      x += 1
      h_max = h[i]
  
print(x)

Submission status: Accepted

Solution code:
c = 0
n = int(input())
li = list(map(int,input().split()))
li1 = []
for a in li:
    li1.append(a)
    if a >= max(li1):
            c += 1
print(c)

Submission status: Accepted

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

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

print (count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from itertools import accumulate
N = int(input())
h_list = list(map(int, input().split()))

h_max = list(accumulate(h_list, max))
ans = 0
for h, m in zip(h_list, h_max):
    if m <= h:
        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, len(h)):
    if max(h[:i]) <= h[i]:
        ans += 1
print(ans)

Submission status: Accepted

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

cnt=0
Temp=[]
for i in Heights:
  Temp.append(i)
  if all([x<=i for x in Temp]):
    cnt += 1

print(cnt)

Submission status: Accepted

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

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

print(count+1)

Submission status: Accepted

Solution code:
length = int(input())
a = input().split()
count = 1
max_height = int(a[0])
for i in range(1,length):
    i_height = int(a[i])
    if (max_height <= i_height):
        count += 1
        max_height = i_height

print(count)

Submission status: Accepted

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

min_h = 0
result = 0

for h in hs:
    if h >= min_h:
        result += 1
        min_h = h
print(result)

Submission status: Accepted

Solution code:
cnt = int(input())
all_mntns = map(int,input().split(" "))
max_height = 0
view_cnt = 0


for mntn in all_mntns:
  if mntn >= max_height:
    view_cnt = view_cnt + 1
    max_height = mntn
print (view_cnt)

Submission status: Accepted

Solution code:
N = int(input())
h_list = list(map(int, input().split()))
from itertools import accumulate

h_max = list(accumulate(h_list, max))
ans = 0
for i in range(N):
    tmp = h_max[i]
    h = h_list[i]
    if tmp <= h:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
# coding:utf-8
n = int(input())
h = list(map(int, input().split()))
counter = 0
 
for i in range(n):
    #print(h[0:i+1])
    h_max = max(h[0:i+1])
    if (h[i] >= h_max) and (h[i] >= h[0]):
        #print(h[i])
        counter += 1
print(counter)

Submission status: Accepted

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

count = 1
max_h = H[0]

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

Submission status: Accepted

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

max_tmp=0
ans=0

for i in range(N):
    if h[i] >= max_tmp:
        ans += 1
        max_tmp = h[i]

print(ans)

Submission status: Accepted

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

result, max = 0, 0
for h in h_l:
    if h >= max:
        result += 1
        max = h
print(result)