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=input().split()
H=[int(i) for i in H]
cnt=1
key=False

for i in range(N):
    for j in range(i):
        if H[i]<H[j]:
            key=False
            break
        else:
            key=True
    if key==True:
        cnt+=1
    key=False
    
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 = [0]*N
H = input().split()
H = [int(h) for h in H]
for i in range(0, N-1):
    for j in range(i+1, N):
        if H[i] > H[j]:
            H[j] = 0
H = [h!=0 for h in H]
print(sum(H))

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
v_max = 0

for h in hs:
  if v_max <=h:
    count += 1
    v_max = h
print(count)

Submission status: Accepted

Solution code:
a=int(input())
List=list(map(int,input().split()))
c = 0

for i in range(a):
    if max(List[:i+1]) == List[i]:
        c +=1
print(c)

Submission status: Accepted

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

sub = 0
ans = 0
for i in range(n):
    if(sub <= H_list[i]):
        sub = max(H_list[i], sub)
        ans += 1

print(ans)

Submission status: Accepted

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

for i in range(n):
	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()))

ans = 1
ml = []

for i in range(n-1):
    ml.append(h[i])
    if h[i + 1] >= max(ml):
        ans += 1

print(ans)

Submission status: Accepted

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

h_max = 0
ans = 0
for i in range(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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 124
# https://atcoder.jp/contests/abc124
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]
ii2nnn = lambda n: ss2nnn(ii2ss(n))

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

N = i2n()
H = i2nn()
main(N, H)

Submission status: Accepted

Solution code:
input();h = [int(s) for s in input().split()]
r=0
for i in range(len(h)):
    if max(h[:i+1])==h[i]:
        r+=1
print(r)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

if __name__ == "__main__":
    n = int(input())
    h = list(map(int, input().split()))
    hlim = 0
    count = 0
    for hotel in h:
        if hotel >= hlim:
            hlim = hotel
            count += 1
        else:
            pass
    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

tmp = H_arr[0]
ans = 1
for i in range(1,N):
    if H_arr[i] < tmp:
        pass
    else:
        tmp = H_arr[i]
        ans += 1

print(ans)

Submission status: Accepted

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

count = 0
for i in range(len(h_list)):
    if max(h_list[:i+1]) == h_list[i]:
        count += 1
print(count)

Submission status: Accepted

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


# globals
inf = float('inf')
N = 0


def set_inputs():
    global N
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    # ----------MAIN----------
    n = get_int()
    h = get_li()
    highest = 0
    ans = 0
    for hi in h:
        if hi >= highest:
            ans += 1
            highest = hi
    print(ans)
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int(input())
    ryokans = list(map(lambda x: int(x), input().split()))

    answer = 0
    for i in range(n):
        ryokans_before_target = ryokans[:i+1]
        highest_indexes = [i for i, x in enumerate(ryokans_before_target) if x == max(ryokans_before_target)]

        if i in highest_indexes:
            answer += 1
    
    print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
heights=list(map(int,input().split()))
#print(heights)

cnt=0
maxH=0

for height in heights:
    if maxH<=height:
        maxH=height
        cnt+=1

print(cnt)

Submission status: Accepted

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

m = arr[0]
ans = 0
for a in arr:
  if a>=m: 
    ans += 1
    m = a
print(ans)

Submission status: Accepted

Solution code:
count = int(input())
m = 0
c = 0
vals = input().split(" ")
for i in vals:
  val = int(i)
  m = max(m, val)
  if val >= m:
    c = c + 1
print(c)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力
l = list(map(int, input().split()))
# 文字列の入力

cnt = 1
for i, v in enumerate(l):
  if i >= 1:
    #print(i,v)
    #print(l[:i])
    if max(l[:i]) <= v:
      cnt += 1

print(cnt)
# 出力
#print("{} {}".format(l, a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
for i, h in enumerate(H):
  if(max(H[0:i+1]) <= h):
    cnt+=1

print(cnt)

Submission status: Accepted

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

cnt = 0
maxH = 0

for height in heights:
    if maxH <= height:
        maxH = height
        cnt += 1


print(cnt)

Submission status: Accepted

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

m = 0  # 最大
re = 0
for i in range(N):
    if m <= H[i]:
        re += 1
        m = H[i]
        
print(re)

Submission status: Accepted

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

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

Submission status: Accepted

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

pre = 0
ans = 0
for i in H:
    if i >= pre:
        ans += 1
        pre = i

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
l = input().split()
l = np.array(l)
l = l.astype(int)
count = 1
for i in range(1, len(l)):
    if np.max(l[:i]) <= l[i]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())

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

max_height = li_h[0]
counter = 1

for i in range(1, n):
    if max_height <= li_h[i]:
        counter += 1
    max_height = max(max_height, li_h[i])

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = 0
highest_mountain =-1
flag = 0

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
length = int(raw_input())
M = map(int, raw_input().split())

count = 0
h = 0

for m in M:
    if int(m) >= h:
        count = count + 1
        h = m 
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

#d = np.diff(np.array(a))
#print(d)
count =0
x = 0
#for i in d:
#  if i > 0:
#    count+=1
#print(count+1)    
for i in a:
  if x <= i:
    x = max(x,i)
    count +=1
    
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

high = 0
score = 0
for value in H:
   if high <= value:
      high = value
      score += 1
      
print(score)

Submission status: Accepted

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

Submission status: Accepted

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

max = 0
cnt = 0
for i in range(n):
  if max <= hl[i]:
    cnt += 1
    max = hl[i]

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h_list = [int(i) for i in input().split()]
whole_list = [h_list[0:i] for i in range(1, n+1)]
count = sum(max(j) == j[-1] for i in range(1, n+1) for j in [h_list[0:i]])
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
for i in range(1, n):
  flag = True
  for j in range(i):
    if h_list[j] > h_list[i]:
      flag = False
      break
  if flag:
    count +=1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
tmp_lst = input().split()
H_lst = []
for i in range(N):
    H_lst.append(int(tmp_lst[i]))

count = 1   #   一番西の必ず見えるところ
for i in range(1,N):
    ocean_vew = True
    for j in range(i):
        if H_lst[j] > H_lst[i]:
            ocean_vew = False
            break
    if ocean_vew:
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
max_num = 1
cnt = 0
list_num = [int(x) for x in input().split()]
for i in range(len(list_num)):
	if max_num <= list_num[i]:
		cnt += 1
		max_num = list_num[i]
print(cnt)

Submission status: Accepted

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

for m in range(1,N):
    if H[m] - maxH >= 0:
        maxH = H[m]
        cnt += 1

print(cnt+1)

Submission status: Accepted

Solution code:
num_mountain = int(input())
mountains = list(map(int, input().split()))
ans = 1

for my_index in range(num_mountain):
    for opp_index in range(my_index):
        if mountains[opp_index] > mountains[my_index]:
            break
        if my_index - opp_index == 1:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
inpl = list(map(int,input().split()))
for i in range(len(inpl)):
    for i2 in range(i,-1,-1):
        if inpl[i] < inpl[i2]:
            N -= 1
            break
print(N)

Submission status: Accepted

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

count = 0
max_h = 0

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

Submission status: Accepted

Solution code:
n = int(input())
H = [int(i) for i in input().strip().split()]
 
border = 0
can_num = 0
for h in H:
  if h >= border:
    can_num += 1
    border = h
 
print(can_num)

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())
h = input().split()
h_int = [int(i) for i in h]
count = 0
flag = 0

for i in range(n):
    #print(i)
    for j in range(i):
        if h_int[i] < h_int[i-1-j]:
            #print("{} {}".format(h[i-j], h[i]))
            flag = 1
            break
    if flag == 0:
        count += 1
    else:
        flag = 0

print(count)

Submission status: Accepted

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


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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
h = list(map(int, input().split()))
first = h[0]
for i in range(1, first):
    num = h.count(i)
    for j in range(num):
        h.remove(i)
deled_num = len(h)
x = 0
for j in range(deled_num - 1):
    if h[x] > h[x+1]:
        h.pop(x+1)
    else:
        x += 1
print(len(h))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = []*100
H[:] = map(int, input().split())
ct = 1
for i in range(N-1):
    maxim = max(H[:i+1])
    if H[i+1] >= maxim:
        ct += 1
print(ct)

Submission status: Accepted

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

Submission status: Accepted

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

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:
    highest = H[i]
    count += 1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = input().split()
num = 1

h = [int(s) for s in h]
for i in range(1, n):
    for j in range(0, i+1):
        if h[j] > h[i]:
            break
        if i == j:
            num += 1

print(num)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
lst = list(map(int,input().split()))

max = 0
sum = 0
for i in range(N):
    if max <= lst[i]:
        sum = sum + 1
        max = lst[i]

print(sum)

Submission status: Accepted

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

for i, h in enumerate(h_a):
    if h >= max(h_a[0:i+1]):
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    
    n = int(input())
    l = list(map(int, input().split()))
    
    view = 0
    
    for i in range(len(l)):
        if max(l[:i + 1]) <= l[i]:
            view = view + 1
            
    print(view)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = input()
mt_lst = list(map(int, input().split()))
cnt = 0

for i in range(len(mt_lst)):
    tmp = mt_lst[0:i+1]
    cnt += 1 if mt_lst[i] == max(tmp) else 0

print(cnt)

Submission status: Accepted

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

j = 0
count = 0

for i in range(mt):

    visible_flg = True

    j = i

    while j > 0:
        if mt_list[i] < mt_list[j-1]:
            visible_flg = False
            break
        j -= 1
    
    if visible_flg:
        count += 1

print(count)

Submission status: Accepted

Solution code:
from sys import stdin
 
N = int(input())
H = [int(x) for x in stdin.readline().rstrip().split()]
 
c = 1
for i in reversed(range(1,N)):
  if H[i] - H[i-1] >= 0 and H[i] == max(H[:i+1]):
    c += 1
 
print(c)

Submission status: Accepted

Solution code:
N = int(input()) 
hotel = list(map(int, input().split())) #入力してint型リストに格納
view = 1

for i in range (1, N, 1):
    judge = 1
    for j in range (0, i, 1):
        if hotel[i] >= hotel[j]:
            pass#何もしない
        else:
            judge = 0
            break
    if judge == 1:
        view += 1

print (view)

Submission status: Accepted

Solution code:
N = int(input())

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

count = 0

for i in range(N):
    cansee = True
    for j in range(i):
        if H[j] > H[i]:
            cansee = False
    
    if cansee:
        count += 1

print(count)

Submission status: Accepted

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

result = 1
max_hi = h_li[0]
for i in h_li[1:]:
    if max_hi <= i:
        result = result + 1
        max_hi = i

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

h, N = H[0], 1
for h_i in H[1:]:
    if h_i >= h:
        N += 1
        h = h_i
print(N)

Submission status: Accepted

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

Submission status: Accepted

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

ct = 1
for i in range(n-1):
  if max(lst[0:i+1]) <= lst[i+1]:
    ct+=1
    #print("ct =", ct)
print(ct)

Submission status: Accepted

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


def main():
    n = int(input())
    h = list(map(int, input().split()))
    highest = 0
    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for a in h:
    if a >= max_h:
        cnt += 1
        max_h = a
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

sum=1
max=List[0]
for i in List:
    if max<=i:
        max=i
        sum+=1

print(sum-1)

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())
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())
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:
def can_view(s):
  t = s[-1]
  for h in s[:-1]:
    if h > t:
      return False
  return True

c = int(input())
hs = list(map(int, input().split(" ")))
a = 0
for i in range(c):
  if can_view(hs[:i+1]):
    a+=1
print(a)

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

Submission status: Accepted

Solution code:
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n

INF = 10**18

class Debug():
    def __init__(self):
        self.debug = True
 
    def off(self):
        self.debug = False
 
    def dmp(self, x, cmt=''):
        if self.debug:
            if cmt != '':
                w = cmt + ': ' + str(x)
            else:
                w = str(x)
            print(w)
        return x

def prob_1():
    d = Debug()
    d.off()
    S = input()
    d.dmp((S),'S')
    count = 0
    zeroFound = False
    for c in S:
        #d.dmp((c),'c')
        if c == '0':
            zeroFound = True
        elif c == '+':
            if zeroFound:
                zeroFound = False
            else:
                count += 1
        #d.dmp((count),'count')
    if not zeroFound:
        count += 1
    return count

def prob():
    d = Debug()
    d.off()
    N = getInt()
    H = getIntList()
    d.dmp((N,H),'N,H')
    v = zeros(N)
    v[0] = H[0]
    count = 1
    for i in range(N-1):
        if v[i] <= H[i+1]:
            v[i+1] = H[i+1]
            count += 1
        else:
            v[i+1] = v[i]
    d.dmp((v),'v')
    return count


ans = prob()
print(ans)

Submission status: Accepted

Solution code:
import re
import sys
from itertools import product

import numpy as np

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N = ii()
    H = il()
    first = H[0]
    count = 1
    for h in H[1:]:
        if first <= h:
            count += 1
            first = h
    return count


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
# B - Great Ocean View
n = int(input())
heights = list(map(int, input().split()))
highest = heights[0]
hotels = 1
for i in heights[1:]:
	if i >= highest:
		hotels += 1
		highest = i
print(hotels)

Submission status: Accepted

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

max_list = []
for i in range(n):
    if i == 0:
        max_list.append(height_list[i])
    else:
        if height_list[i] >= max_list[-1]:
            max_list.append(height_list[i])

print(len(max_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
hn = list(map(int, input().split(' ')))
cnt = 0
max_h = 0
for hi in hn:
  if max_h <= hi:
    cnt += 1
  max_h = max(max_h, hi)
print(cnt)

Submission status: Accepted

Solution code:
# ABC124B - Great Ocean View
n = int(input())
data = list(map(int, input().rstrip().split()))
count = 1

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

Submission status: Accepted

Solution code:


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

can_view = [0]

for i in range(N):
    if i == 0:
        continue
    
    count = 0
    for j in range(i):
        if H[i] >= H[j]:
            count += 1
    
    if count == i:
        can_view.append(i)
print(len(can_view))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 入力
N = int(input())
Hi = input().split()
count = 0
H0 = 0
# 判定
for i in range(N):
    if int(Hi[i]) >= int(H0):
        count += 1
        H0 = Hi[i]
print(count)

Submission status: Accepted

Solution code:
N = input()
Hi = input().split()
count = 0
mV = 0
for i in range(int(N)):
       if int(Hi[i]) >= int(mV):
           count += 1
           mV = Hi[i]
print(count)

Submission status: Accepted

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

    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input());hl = [int(n) for n in input().split()][:n];print(sum([1 for ln in[len([n for n in hl[:i] if n>hl[i]]) for i in range(n)] if ln == 0]))

Submission status: Accepted

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


def main():
    n = int(input())
    heights = list(map(int, input().split()))
    heights = heights[:n]

    if n < 1:
        print(0)
        return

    total = 1
    max_h = heights[0]
    for h in heights[1:]:
        if max_h <= h:
            total += 1
            max_h = h

    print(total)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	N = int(input())
	H = list(map(int, input().split()))

	max_height = 0
	ans = 0
	for i in H:
		if i >= max_height : 
			max_height = i
			ans += 1

	print(ans)

Submission status: Accepted

Solution code:
str = input().split()
str2 = input().split()

a = int(str[0])

i = 1
b = int(str2[0])

for j in range(a-1):
    if b <= int(str2[j+1]):
        i = i + 1
        b = int(str2[j+1])
 
print(i)