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:
def solve():
    N = int(raw_input())
    H = [int(_) for _ in raw_input().split()]
    MaxH = H[0]
    cnt = 1
    for i in range(1,N):
        if H[i] >= MaxH:
            cnt += 1
            MaxH = H[i]
    print str(cnt)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
H=[int(i) for i in input().split()]
hotel=0
for i in range(N):
    count=0
    for k in range(i):
        if H[k]<=H[i]:
            count+=1
        continue
            
    if count==i:
        hotel+=1


print(hotel)

Submission status: Accepted

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

v = [True] * l

for i in range(l):
    for j in range(i + 1, l):
        if v[j]:
            v[j] = (heights[i] <= heights[j])

print(sum(v))

Submission status: Accepted

Solution code:

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

M = [0] * (N+1)

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

print(SUM)

Submission status: Accepted

Solution code:
'''input
5
9 5 6 8 4
'''
N=int(input())
H=list(map(int,input().split()))
count=1

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_ = input()
max_h = 0
count = 0
high = map(int, input().split())
for height in high:
    if max_h <= height:
        max_h = height
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
m = 0
c = 0
for i in A:
    if m <= i:
        c += 1
        m = i

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    N = int(input())
    H = [int(h) for h in input().split()]
    
    main(N, H)

Submission status: Accepted

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

count = 0

High = H[0]

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

print(count)

Submission status: Accepted

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

count = 0
high = h[0]

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

print(count)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, h = int(input()), [int(x) for x in (input().split())]
c,m = 0, 0;

for x in (range(n)):
   if (m <= h[x]):
      m,c = h[x],c+1

print(c)

Submission status: Accepted

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

print(x)

Submission status: Accepted

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

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
previous = 0
for i in range(len(lst)):
  if previous <= lst[i]:
    cnt += 1
    previous = lst[i]
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

a = 1

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

print(a)

Submission status: Accepted

Solution code:

# coding: utf-8

# In[5]:

import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))


# In[6]:

base = A[0]
counter = 1
for i in range(1, N):
    if A[i] >= base:
        counter += 1
        base = A[i]
print(counter)


# In[ ]:

Submission status: Accepted

Solution code:

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

#処理
ans = 0
#iは今見ている山
for i in range(N):

    #自分より高い山がなかったかどうかのフラグ
    flag = True

    #j これから調べる山 iより西側なので、i未満について調べる
    for j in range(0,i):
        if H[j] > H[i]:
            flag = False
    if flag:
        ans+=1

#出力
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inf = float("inf")

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
def input_int():return int(input())
def input_ints():return map(int,input().split())
def input_ints_list():return list(input_ints())
def input_str():return input()
def input_strs():return input().split()
def input_lines(n,f):return [f() for _ in range(n)]

import importlib
def import_module(name):return importlib.import_module(name)

def gcd_base(a,b):return import_module('fractions').gcd(a,b) # 最大公約数（2値)
def gcd(a):return import_module('functools').reduce(gcd_base,a) # 最大公約数（リスト）
def lcm_base(a,b):return (a*b)//gcd_base(a,b) # 最小公倍数(2値)
def lcm(a):return import_module('functools').reduce(lcm_base,a,1) # 最小公倍数(リスト)

def permutations(a,n):return import_module('itertools').permutations(a,n) # 順列
def combinations(a,n):return import_module('itertools').combinations(a,n) # 組み合わせ
def product(a,b):return import_module('itertools').product(a,b) # 二つのリストの直積

def init_array_1dim(v,n):return [v]*n
def init_array_2dim(v,n,m):return [init_array_1dim for _ in range(m)]

# 四捨五入はround
def ceil(a):return import_module('math').ceil(a) # 切り上げ
def floor(a):return import_module('math').floor(a) # 切り捨て

# キュー
def init_q(a):return import_module('collections').deque(a)
def q_pop(a):return a.popleft()
def q_push(a,v):a.appendleft(v)
def q_pushlist(a,l):a.extendleft(l)
def q_append(a,v):a.append(v)
def q_appendlist(a,l):a.extend(l)

# プライオリティキュー
def init_heap(a):import_module('heapq').heapify(a)
def heap_push(a,v):import_module('heapq').heappush(a,v)
def heap_pop(a):return import_module('heapq').heappop(a) # 最小値を取り出す

# 二分探索
def bisect_left(a,x):return import_module('bisect').bisect_left(a,x)
def bisect_right(a,x):return import_module('bisect').bisect_left(a,x)
def insert_left(a,x):return import_module('bisect').insert_left(a,bisect_left(a,x))
def insert_right(a,x):return import_module('bisect').insert_right(a,bisect_right(a,x))

# 累積和、累積積、累積GCD
def cumsum(a):return import_module('numpy').cumsum(import_module('numpy').array(a)) # 累積和
def cumprod(a):return import_module('numpy').cumprod(import_module('numpy').array(a)) # 累積積
def cumgcd(a):return import_module('numpy').frompyfunc(gcd_base, 2, 1).accumulate(a, dtype=import_module('numpy').object).astype(import_module('numpy').int) # 累積GCD

class UnionFind(object):
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    def get_size(self, x):
        x = self.find(x)
        return self.size[x]

def dfs(pos):
    ret = 0
    l = []
    for e in l:
        next = e
        ret += dfs(next)
    return ret

def bfs(l):
    q = init_q(l)
    pos = 0
    q_push(q,pos)
    while q:
        now = q_pop(q)
        for e in l:
            next = e
            q_append(q,next)

# ワーシャルフロイド（グラフの要素数、グラフ）
def warshall_floyd(n,graph):
    d = init_array_2dim(float("inf"),n,n)
    # 初期化
    for i in range(n):
        d[i][i] = 0
        for j in range(n):
            if graph[i][j]:d[i][j] = 1
    # 距離算出
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d

# グラフを初期化（グラフの要素数、グラフの線の両端、有向無向）
def init_graph(n,a,directed=False):
    visited = init_array_1dim(False,n)
    graph = init_array_2dim(False,n,n)
    for e in a:
        graph[e[0]-1][e[1]-1] = True
        if not directed:graph[e[1]-1][e[0]-1] = True # 無向グラフの場合
    return visited,graph

def two_pointers(s,threshold,ope='sum'):
    l,r = 0,0
    base = 0 
    if ope == 'sum':base = 0
    if ope == 'prd':base = 1
    diff = 0
    while r < len(s):
        val = 0
        if ope == 'sum':val = base+s[r]
        if ope == 'prd':val = base*s[r]
        if val <= threshold:
            if ope == 'sum':base += s[r]
            if ope == 'prd':base *= s[r]
            diff = max(diff, r-l+1)
            r += 1
        elif l == r:
            r += 1
            l += 1
        else:
            if ope == 'sum':base -= s[l]
            if ope == 'prd':base //= s[l]
            l += 1
    return diff

# ここに実装
def solution():
    global N,H
    N = input_int()
    H = input_ints_list()

    t = 0
    ret = 0
    for h in H:
        if t <= h:
            ret += 1
            t = h
    print(ret)

if __name__ == '__main__':
    solution()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


def main():
    n = int(input())
    h = map(int, input().split())
    current_max = 0
    ans = 0
    for hi in h:
        if hi >= current_max:
            ans += 1
        if hi > current_max:
            current_max = hi
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
lia=[int(it) for it in input().split()]
lib=[0]*N

ma = -1
s=0
for i in range(N):
  if (lia[i]>=ma):
    s+=1
  ma = max(lia[i],ma)
print (s)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(count)

Submission status: Accepted

Solution code:
def countInn(n, L):
  numInn = 1
  mainHurdle = L[0]
  hurdle = mainHurdle
  for i in range(1, n):
    currentH = L[i]
    if currentH < mainHurdle or currentH < hurdle:
      continue
    numInn += 1
    hurdle = currentH
  print(numInn)
  
n = int(input())
a = list(map(int, input().split()))
countInn(n, a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
str_hlist = input().split(' ')

count = 0
height = 0

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())
h_list = map(int,input().split())
cnt = 0
max_h = 0

for h in h_list:
    max_h = max(max_h, h)
    if max_h == h:
        cnt += 1
  
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    b = a[:i+1]
    c = sorted(b,reverse=True)
    if c[0]==b[i]:
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
mounts =list(map(int, input().split()))
#print(mounts)

counter = 1
comp = []
comp.append(mounts[0])

for mount in mounts[1:]:
    Flag = False
    #print("count{} mount{}".format(counter, mount))
    for c in comp:
        if c > mount:
            Flag = True
            break
    if not Flag:
        counter += 1
    comp.append(mount)
    #print(counter)

print(counter)

Submission status: Accepted

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

max_height = 0
counter = 0
for i in range(n):
  if hhh[i] >= max_height:
    max_height = hhh[i]
    counter += 1

print(counter)

Submission status: Accepted

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

max_hs = [0]
for h in hs:
  max_hs.append(max(max_hs[-1], h))

count = 0
for h, max_h in zip(hs, max_hs[1:]):
  if h >= max_h:
    count += 1
  
print(count)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

tmp = arr[0]
ans = 0

for i in range(n):
	if tmp <= arr[i]:
		ans += 1
		tmp = arr[i]

print(ans)

Submission status: Accepted

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

h_max = hs[0]
viewable = [hs[0]]
for i in range(1, n):
    h_height = hs[i]
    if h_height < h_max:
        continue
    h_max = h_height
    viewable.append(h_height)

print(len(viewable))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

Submission status: Accepted

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

cnt=0

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

Submission status: Accepted

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

max = num[0]
count = 1

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import *

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

print(1 + sum([
    int(all([ hj <= h for hj in islice(Hn, i+1) ]))
    for i, h in enumerate(Hn[1:])
]))

Submission status: Accepted

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

hantei = 1

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

Submission status: Accepted

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

highest = 0
count= 0

for top_i in H:
    if(top_i >= highest):
        count += 1
        highest = top_i

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ocean = 1
for i in range(1, n):
    count = 0
    for j in range(0, i):
        if H[j] > H[i]:
            count += 1
        if count >= 1:
            break
    if count == 0:
        ocean += 1

if n == 1:
    print(1)
else:
    print(ocean)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
for i in range(n):
  if i == 0:
    ans += 1
  else:
    if max(lih[0:i]) <= lih[i]:
      ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
size=int(input())
mountain=input().split()
count=0
highest=0
for i in range(0,size):
    if(int(mountain[i])>=highest):
        count+=1
        highest=int(mountain[i])
    else:
        continue
print(count)

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:
a=int(input())
p=list(map(int,input().split()))
n=0

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

Submission status: Accepted

Solution code:
N = int(input())
HEIGHTS = list(map(int, input().split()))
result = 0

for i in range(N):
    if HEIGHTS[i] == max(HEIGHTS[:i+1]):
        result += 1
    else:
        continue

print(result)

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
t = 0
m = a[t]
for x in a:
    if x == m:
        t = t+1
    elif x > m:
        t = t+1
        m = x

print(t)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
t = 0
m = a[0]
for x in a:
    if x == m:
        t += 1
    elif x > m:
        t += 1
        m = x

print(t)

Submission status: Accepted

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


cnt = 0
for i in range(N):
    isSucces = True
    for j in range(i):
        if H[j] > H[i]:
            isSucces = False
            break
    if isSucces:
        cnt += 1

print(cnt)

Submission status: Accepted

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

able_h = []
for i in range(n):
    count = 0
   

    

    for j in range(i):
        if h_para[i] >= h_para[j] :
            count = count
        else :
            count += 1
    if count == 0 : able_h.append(i)

print(len(able_h))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nn = int(input())
hh = list(map(int, input().split()))
aa = 0

for ii in range(nn):
    mm = max(hh[:ii+1])
    if mm == hh[ii]:
        aa += 1
    
print(aa)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

def main():
    N = int(input())
    H = list(map(int, input().split()))
    num = 0
    border = 0
    for i in range(N):
        if H[i] - border >= 0:
            num += 1
            border = H[i]

    print(num)

if __name__ == "__main__":
    main()

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:
# input
n = int(input())
hs = tuple(int(i) for i in input().split())

count = 0
for i, h in enumerate(hs):
    if all(hh <= h for hh in hs[:i]):
        count += 1

print(count)

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]

ans = 0
f = False
for i in range(N):
    for j in range(i):
        if data[j] > data[i]:
            f = True
    if not f:
        ans += 1
    f = False

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

x = 0
for i in range(len(l)):
    if l[i] == max(l[:i+1]):
        x += 1

print(x)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
H = h[0]

for i in range(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()))
cnt = []
max = 0
for i in range(n):
  if h[i] >= max:
    max = h[i]
    cnt.append(h[i])
print(len(cnt))

Submission status: Accepted

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

Submission status: Accepted

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

# solve
ans = 0
maxHeight = 0

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

Submission status: Accepted

Solution code:
m=int(input())
a=list(map(int,input().split()))
D=1
n=1

while n < m:
 if a[n] < max(a[0:n]):
  D=D 
  n=n+1
 else:
  D=D+1 
  n=n+1

print(D)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
#N=5
#H=[10,7,37,69,5]
Max=0
count=0
for i in range(N):
    if H[i]>=Max:
        Max=H[i]
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
height = h[0]
for i in range(n-1):
    if height <= h[i+1]:
        ans += 1
        height = h[i+1] # 高さを更新
    # print(ans,height)

print(ans)

Submission status: Accepted

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

t = -1
ans = 0

for i in h:
    if t <= i:
       ans += 1
       t = i

print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
nums = list(map(int, input().split()))
 
maxx = 0
count = 0
for n in nums:
    if n>=maxx:
        maxx = n
        count += 1
 
print(count)

Submission status: Accepted

Solution code:
N=int(input())
H= [int(h) for h in input().split()]
Hmax=[]
for n in range(N):
    Hmax.append(max(hi for i,hi in enumerate(H) if i<=n))


print(sum(Hmax[i]<=H[i] for i in range(N)))

Submission status: Accepted

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

counter = 0
imax = 0

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


print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

L = [0] * N
L[0] = H[0]

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

print (count)