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 = [int(_) for _ in input().split()]

res = 0
tmp = 0
for i in H:
    if i >= tmp:
        res += 1
        tmp = i

print(res)

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:
# 2019/04/13
# AtCoder Beginner Contest 124 - B

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

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

# Output
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 1

for i in range(1,N):
    f = True
    for j in range(0,i):
        if H[j] > H[i]:
            f = False
    if f==True:
        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]>=MAX:
        ANS+=1
        MAX=max(MAX,H[i])

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

Submission status: Accepted

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

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

Submission status: Accepted

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

maxi = 0
cnt  = 0
for v in H:
    if v >= maxi:
        cnt += 1
        maxi = v

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ct)

Submission status: Accepted

Solution code:
#coding:utf-8

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


count = 0
max_ = -10
for i in range(N):
    if H[i] >=max_:
        count += 1
        max_ = H[i]

print(count)

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    count = 0
    max_H = 0
    H = [int(input_raw[i]) for i in range(N)]
    for i in range(N):
        if H[i] >= max_H:
            count += 1
            max_H = H[i]
    print count


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

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

solve()

Submission status: Accepted

Solution code:
n=int(input())
list=input().split(" ")
inst=[]
for i in list:
    inst.append(int(i))


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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
max_height = heights[0]

for i in range(1, len(heights)):
	if heights[i] >= max_height:
		count += 1
		max_height = heights[i]

print(count)

Submission status: Accepted

Solution code:
n = input()

hs = input()
hs = hs.split()

count = 0
max_hs = 0

for hss in hs:
    hss = int(hss)
    max_hs = max(hss, max_hs)
    if hss >= max_hs:
        count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

temp = 0
ct = 0
for h in H:
    if h >= temp:
        ct += 1
        temp = h

print(ct)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    m = 0
    h = [int(x) for x in input().split()]
    count = 0
    
    for i in h:
        if m <= i:
            count += 1
            m = i
    
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,h=open(0);*h,=map(int,[0]+h.split());print(sum(h[i]>=max(h[:i])for i in range(1,int(n)+1)))

Submission status: Accepted

Solution code:
N = int(input())
H = [int(_) for _ in input().split()]
yama = 0
ans = 0
for i in H:
    if yama <= i:
        ans += 1
        yama = i

print(ans)

Submission status: Accepted

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

m = H[0]
cnt = 0
for h in H:
  if m <= h:
    cnt += 1
    m = h

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

Submission status: Accepted

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

index = 0
ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

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

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n = II()
    H = LI()

    res = 0
    for i in range(n)[::-1]:
        for j in range(i):
            if H[i] < H[j]:
                break
        else:
            res += 1

    return res


print(main())

Submission status: Accepted

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

print(sum([1 if max(H[0:i]) <= H[i] else 0 for i in range(1,len(H))])+1)

Submission status: Accepted

Solution code:
def solve(n, h_list):
    m = 0
    vc = 0
    for h in h_list:
        if m <= h:
            vc += 1
            m = h
    print(vc)

n = int(input())
h_list = map(int,input().split())    
solve(n, h_list)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
maxMount = 0
for H in HList:
    if H >= maxMount:
        ans += 1
        maxMount = H

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

reatInt = lambda: int(sys.stdin.readline())
reatIntN = lambda: [int(v) for v in sys.stdin.readline().split(' ')]


n = reatInt()
hs = reatIntN()

maxv = 0
ret = 0
for h in hs:
    if maxv <= h:
        ret += 1
        maxv = h
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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


ans = 0
for i in range(N):
	f = True
	for j in range(i):
		if H[i] < H[j]:
			f = False
			break
	if f:
		ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

h = 0
c = 0
for hi in HN:
    if hi >= h:
        c += 1
    h = max(h, hi)

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
g = 0
for h in H:
    # print(h, g)
    if h >= g:
        count += 1
        g = h

print(count)

Submission status: Accepted

Solution code:
n = int(input())

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

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

print(ans)

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools


# ひとつ入力
n = int(input())

# リストに入れる
h = [int(i) for i in input().split()] 

highest = 0
answer = 0

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

Submission status: Accepted

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

highest = 0
ans = 0

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

print(ans)

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

Solution code:
N = int(input())
H = [int(_) for _ in input().split()]
ans = N
for i in range(N):
    for j in range(i):
        if H[j] > H[i]:
            ans -= 1
            break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
li=list(map(int,input().split()))
#print(li)
vi=1
maxi=li[0]
for i in range(1,N):
    if maxi<=li[i]:
        maxi=li[i]
        vi+=1
print(vi)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

max = -1
ans = 0
for i in H:
    if max <= i:
        max = i
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 20:57:38 2019

@author: Yamazaki Kenichi
"""

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

ans = 0
h0 = H[0]
for h in H:
    if h0 <= h:
        ans += 1
        h0 = h

print(ans)

Submission status: Accepted

Solution code:
def solve():
  N = int(input())
  H = [int(i) for i in input().split()]
  cnt = 0
  highest = 0
  for h in H:
    if h >= highest:
      cnt = cnt + 1
      highest = h
  return cnt

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
arr = [int(item) for item in input().split()]
mh = 0
c = 0
for i in arr:
  if mh <= i:
    c += 1
    mh = i
print(c)

Submission status: Accepted

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

count = 1
for i in range(1, len(h)):
    flag = True
    for j in range(i):
        if (h[j] > h[i]):
            flag = False

    if flag:
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
L.insert(0,0)
ans = 0
for i in range(1,N+1):
  k = L[i]
  flag = True
  for j in range(i):
    if k >= L[j]:
      None
    else:
      flag = False
      break
  if flag:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0
maxh = 0
for i in H:
    if maxh <= i:
        cnt += 1
        maxh = i

print(cnt)

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

Submission status: Accepted

Solution code:
N = int(input())
As = [int(a) for a in input().split()]
hmax = 0
count = 0
for A in As:
    if hmax <= A:
        hmax = A
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
hh = list(map(int, input().split()))
hh.insert(0, 0)

cnt = 0
for i in range(1, len(hh)):
    for j in range(0, i):
        if hh[i] < hh[j]:
            break
    else:
        cnt += 1

print(cnt)

Submission status: Accepted

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

count = 0
for i,h in enumerate(hList):
    ng = False
    for j in range(i+1):
        if hList[j] > h:
            ng = True
            break
    if ng == False:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
ans = 0
tmpmax = 0
for i, item in enumerate(h):
    if i == 0:
        ans += 1
        tmpmax = item
    elif tmpmax <= item:
        ans += 1
        tmpmax = item
print(ans)

Submission status: Accepted

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

sums = 0
maxv = 0
for h in H:
    if maxv <= h:
        sums += 1
        maxv = h
print(sums)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    hh = list(map(int, input().split()))
    res = 0
    h_max = 0
    for h in hh:
        if h_max <= h:
            res += 1
            h_max = h
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

max_height = 0
counter = 0

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

print(counter)

Submission status: Accepted

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

cnt = 0
m = 0
for h in H:
    m = max(m, h)
    if h>=m:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

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

m = 0
ans = 0

for i in h:
    if i >= m:
        ans+=1
        m = i

print(ans)

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:
# coding: utf-8
N = int(input())
H = list(map(int, input().split()))
ans = 0
min = 0
for h in H:
    if min <= h:
        ans += 1
        min = h
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = int(input())  # 数値入力
str = list(map(int, input().split()))  # リスト入力（数値）  map関数はリストの各要素に対して関数を適用してくれる

max = 0
ans = 0
for i in range(a):
    if max <= str[i]:
        ans += 1
        max = str[i]

print(ans)

Submission status: Accepted

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

h_max = Hs[0]
count = 1

for h in Hs[1:]:
    if h_max <= h:
        count += 1
    h_max = max(h_max, h)
print(count)

Submission status: Accepted

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

ans = 1
for i in range(1, N):
    if H[i] >= max(H[0: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[:i]) <= H[i]:
        ans += 1

print(ans)

Submission status: Accepted

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

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

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

print(count)

Submission status: Accepted

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

for i in range(0, n):
    f = True
    for j in range(0, i):
        if h[j] > h[i]:
            f = False
            break
    if f:
        c += 1

print(c)

Submission status: Accepted

Solution code:

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

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

print(ans)

Submission status: Accepted

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

maxheight = 0
count = 0
for i in range(n):
    height = height_list[i]
    if height>=maxheight:
        count+=1
        maxheight=height
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = na()

b = 0
c = 0
for i in a:
    if b <= i:
        b = i
        c += 1

print(c)

Submission status: Accepted

Solution code:
import collections as c
ip = lambda : map(int, input().split())

#################
N = int(input())
ls = list(map(int, input().split()))
h = 0
ans = 0
for i in ls:
    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()))

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

Submission status: Accepted

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

cnt = 1
tmp = array[0]
for x in range(1, n):
    if array[x] >= tmp:
        tmp = array[x]
        cnt += 1
else:
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

high = 0
c = 0
for h_ in h:
    if high <= h_:
        c += 1
        high = h_
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heappush,heappop

def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))

N = int_raw()
Hs = ints_raw()
def ans():

    ans =0
    for i in range(len(Hs)):
        is_v = 1
        for j in range(i):
            if Hs[i]<Hs[j]:
                is_v=0
                break
        ans+=is_v

    return ans

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

Submission status: Accepted

Solution code:
n = int(input())
hs = list(map(int, input().split()))
count = 0
for i in range(n):
    if i == 0:
        count += 1
        continue
    ok = True
    for j in range(i):
        if hs[j] > hs[i]:
            ok = False
            break
    if ok:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)