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 = input()
input_char = input()
input_char = input_char.split(" ")

mountains_heigh = [int(h) for h in input_char]

viewable_count = 1
for idx,h in enumerate(mountains_heigh):
    if idx >0 :
        max_h_behind = max(mountains_heigh[:idx])
        if max_h_behind <= h :
            viewable_count+= 1

print(viewable_count)

Submission status: Accepted

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

count = 1
for h1 in range(1, N):
    result = True
    for h2 in range(h1):
        if h_list[h2] > h_list[h1]:
            result = False
    if result:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
i = 0
j = 0
k = 0
m = 0

for i in range(n):
    for j in range(i):
        if l[j] >= k:
           k = l[j]
    if l[i] >= k:
        m = m + 1

    
print(m)

Submission status: Accepted

Solution code:
n = int(input())

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

max = h[0]

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

print(s)

Submission status: Accepted

Solution code:
n = int(input())
h_list = list(map(int,input().split()))	
count = 0
view = True
for index,h in enumerate(h_list):
    target_h = h
    for i in range(index):
        if target_h >= h_list[i]:
            pass
        else:
            view = False
            break
    if view:
        count += 1
    view = True

print(count)

Submission status: Accepted

Solution code:

n = int( input() )

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

ans = 0
max_ = H[0]
for hi in H:
    if max_ <= hi:
        ans += 1
        max_ = hi

print(ans)

Submission status: Accepted

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

res = H[0]
num = 0
for i in range(N):
  if res <= H[i]:
    num += 1
    res = H[i]
  else:
    pass
print(num)

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H_list = list(map(int, input().split()))
result = 1
level = H_list.pop(0)
for H in H_list:
    if level <= H:
        result += 1
        level = H
print(result)

Submission status: Accepted

Solution code:
n = int(input())
h_list = list(map(int, input().split()))
h_list = h_list[:n]
count = 0
last_h = 0
for index,h in enumerate(h_list):
	if last_h <= h:
		count += 1
	
	if last_h <= h:
		last_h = h

print(count)

Submission status: Accepted

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

for i in range(1, n):
    no_flag = 0
    for j in range(i):
        if h[j] > h[i]:
            no_flag = 1
        else:
            pass
    if no_flag == 0:
        total += 1

print(total)

Submission status: Accepted

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

ans=0
for i in range(len(h)):
    if i == 0:
        ans+=1
    else:
        high=max(h[:i])
        if h[i]>=high:
            ans+=1

print(ans)

Submission status: Accepted

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

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(int(i) for i in (input().split()))
H_max = []
tmp = 0
cnt = 0
for i in range (N):
  if (tmp < H[i]):
    H_max.append(H[i])
    tmp = H[i]
  else:
    H_max.append(tmp)
  if(H[i] >= H_max[i]):
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
H = input().split()
ans = 1

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:

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

ans = 1
for i, val in enumerate(H):
    if i == 0:
        continue

    if not sum(x > val for x in 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,1):
    flag = True
    for j in range(0,i,1):
        if H[j] > H[i]:
            flag = False
            break
    if flag == True:
        count += 1
print(count)

Submission status: Accepted

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

for i, x in enumerate(h):
    for j in range(i):
        if h[j] > x:
            break
    else:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

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

lis = [h_lis[0]]

ans = []

for x in h_lis:
    if (x >= max(lis)):
        ans.append(x)
    lis.append(x)

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
python3 a.py < input.txt
"""
import math
import itertools as it
import heapq

N=int(input())
H=list(map(int,input().split()))
n=0
print(len([hi for i,hi in enumerate(H) if i == 0 or (i > 0 and max(H[:i]) <= hi)]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin
##  input functions for me
def ria(sep = ''):
    if sep == '' :
        return list(map(int, input().split())) 
    else: return list(map(int, input().split(sep)))
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##

## main ##
N = ri()
H = ria()

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
max = 0
for h in H:
    if max <= h:
        max = h
        count += 1

print(count)

Submission status: Accepted

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

total =0
for n,i in enumerate(l):
    if n == 0:
        total+=1
    else:
        flag = True
        for ii in l[:n]:
            if ii>i:
                flag = False
                break
        if flag:
            total+=1
print(total)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

max_height = 0
count = 0
for H in Hs:
  if max_height <= H:
    count += 1
    max_height = 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 all(h[i] >= h[j] for j in range(i)):
    ans += 1
  else:
    continue
print(ans)

Submission status: Accepted

Solution code:
x = int(input()) # 1 2
h = list(map(int,input().split()))
count = 0
height = 0
for i in range(len(h)):
    if h[i] >= height:
        count += 1
        height = h[i]

print (count)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
n = int(input())
h_list = list(map(int, input().split()))
max_h = 0
cnt = 0
for h in h_list:
    if h >= max_h:
        cnt += 1
        max_h = h
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
h_list = list(map(int,input().split()))
l = []
for i in range(n):
    if i == 0:
        l.append(h_list[i])
    else:
        if h_list[i] >= h_list[i-1] and h_list[i] >= max(l):
            l.append(h_list[i])
print(len(l))

Submission status: Accepted

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

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


print(count)

Submission status: Accepted

Solution code:
import sys

def ii2ss(n):
    return [sys.stdin.readline() for _ in range(n)]

def sp2nn(sp, sep=' '):
    return [int(s) for s in sp.split(sep)]

def ss2nn(ss):
    return [int(s) for s in list(ss)]

def main(ss):
    H = sp2nn(ss[1])
    hmax = -1
    count = 0
    for h in H:
        if h >= hmax:
            count += 1
            hmax = h
    print(count)

main(ii2ss(2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

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

_count=1
max_height=H[0]

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

Submission status: Accepted

Solution code:

N = int(input())
h = map(int,input().split())
H = []
for c in h:
    H.append(int(c))

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

print(count)

Submission status: Accepted

Solution code:
def umi(n,a):
    ii=1 
    for i in range(1,n):
        if a[i]>=max(a[:i]):
            ii += 1
    return ii
n=int(input())
a=list(map(int,input().split()))
print(umi(n,a))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
# import math
import numpy as np
# N = int(stdin.readline().rstrip().split()[0])
# A = [int(x) for x in stdin.readline().rstrip().split()]
# N, X = [int(x) for x in stdin.readline().rstrip().split()]
# S = [int(x) for x in stdin.readline().rstrip().split()]
N = int(stdin.readline().rstrip().split()[0])
H = [int(x) for x in stdin.readline().rstrip().split()]
H = np.array(H)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

result = list(filter(lambda h: h, [Hs[i] == max(Hs[:i + 1]) for i in range(len(Hs))]))
print(len(result))

Submission status: Accepted

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

print(x)

Submission status: Accepted

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

for i, h in enumerate(H):
  if i == 0:
  	maxH = h
  else:
    if h >= maxH:
    	n += 1
    	maxH = h
    
print(n)

Submission status: Accepted

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

Submission status: Accepted

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



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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

count = 1

for i in range(1, N):
    nn = 0
    A = H[:i+1]
    for j in A[:-1]:
        if j > A[-1]:
            nn += 1
    if nn==0:
        count += 1

print(count)

Submission status: Accepted

Solution code:
n=input()
a=list(map(int,input().split(" ")))
count=0
currMax=a[0]-1
for it in a:
    if(it >= currMax):
        count+=1
        currMax=it
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

hotels = [int(c) for c in input().split()]

count = 1
highest = hotels[0]
for i in range(1, len(hotels)):
    if highest <= hotels[i]:
        count += 1
        if highest < hotels[i]:
            highest = hotels[i]

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
yama = [0]
visble = 0
takasa = list(map(int,input().split()))
for n in range(N):
    if max(yama) <= takasa[n]:
        visble += 1
    yama.append(takasa[n])
print(visble)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

# 全探索
ans = 0 # 1番目は見えるので
tmp_max = -1
for i in range(N) :
    if(height_list[i] >= tmp_max) :
        tmp_max = height_list[i]
        ans += 1
        

print(ans)

Submission status: Accepted

Solution code:
import sys

def main(inp):
    N=int(next(inp))
    H=list(map(int,next(inp).split()))
    
    ans=0
    high=0
    for i in range(N):
        if(high<=H[i]): ans+=1
        high=max(high,H[i])
    
    return ans
    
print(main(sys.stdin))

Submission status: Accepted

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

h = 0
num = 0
for i in H:
    if h <= i:
        num += 1
        h = i
print(num)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:

def main():
	N = int(input())
	H = list(map(int,input().split()))
	
	count = 1
	for i,ryokan in enumerate(H[1:]) :
		flag = False
		for o in H[:i+1] :
			if o <= ryokan :
				flag = True
			else :
				flag = False
				break
		if flag == True :
			count += 1
	print(count)

if __name__ == "__main__" :
	main()

Submission status: Accepted

Solution code:

n = int(input())

l = [int(x) for x in input().split()]

maxx = 0
cnt = 0

for i in range(n):
	if maxx <= l[i]:
		maxx = l[i]
		cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
ans = 0
max_height = 0
for hotel in H:
    if hotel >= max_height:
        ans += 1
        max_height = hotel
    else:
        pass

print(ans)

Submission status: Accepted

Solution code:
read = input
n = int(read())
A = list(map(int, read().split()))
cnt = 0
for p in enumerate(A):
    i, x = p
    if i == 0:
        cnt = cnt + 1
    elif x >= max(A[0:i]):
        cnt = cnt + 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

mh = h[0]
cv = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
count = 0
maxh = 0
for x in H:
    if x >= maxh:
        count += 1
        maxh = x
print(count)

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yay!")
    else:print(":(")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
n = ip()                                     #入力整数1つ
#a,b= (int(i) for i in input().split())       #入力整数横2つ以上
a = [int(i) for i in input().split()]        #入力整数配列
#c = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
s = 1
for i in range(1,n):
    if max(a[:(i+1)]) == a[i]: s+=1
print(s)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int,(input().strip().split(' '))))
m = h[0]
t = 1
for i in range(1, len(h)):
    if m <= h[i]:
        m = h[i]
        t += 1
print(t)

Submission status: Accepted

Solution code:
import sys
import itertools

input = sys.stdin.readline

N = int(input())
H = 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(raw_input())
a=map(int, raw_input().split())
ans=0
for i in range(n):
  if i == sum([a[j]<=a[i] for j in range(i)]): ans+=1
print ans

Submission status: Accepted

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

high = H[0]
counter = 0

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

print(counter)

Submission status: Accepted

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

ans = 1
temp = []
for i in range(N-1):
    temp.append(H[i])
    if H[i+1] >= max(temp):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
HH = list(map(int, input().split()))
cnt = 0
for i,H in enumerate(HH):
    flg = True
    if i == 0:
        pass
    else:
        for H2 in HH[:i]:
            if H < H2:
                flg = False
                break
    
    if flg:
        cnt += 1

print(cnt)

Submission status: Accepted

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

index = 0
count = 0
can_see_sea = True
for h in H:
    can_see_sea = True
    for _h in H[0:index]:
        if h < _h:
            can_see_sea = False
            continue
    if can_see_sea:
        count = count + 1
    index = index + 1

print(str(count))

Submission status: Accepted

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

k = 1
tmp = H[0]
for i in range(N-1):
    if H[i+1] >= tmp:
        k += 1
        tmp = H[i+1]
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

def hoge(H, n):
	for i in range(n):
		if H[i]>H[n]:
			return 0
	return 1

count = 0
for i in range(N):
	count += hoge(H, i)

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

max_num = 0
count = 0

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

Submission status: Accepted

Solution code:
n = int(input())
H = list(map(int, input().split()))
#1~N番目の高さを取り出すにはH[N-1]

seeable = 1 #1番めは必ずseeable
for i in range(2, n+1, 1): #2番目~N番目につき
  iseeable = 1
  for j in range(1, i, 1): #1番め~i-1番目につき
    if H[j-1] > H[i-1]: #i番目より高いなら見えない
      iseeable = 0
      break
  seeable += iseeable

print(seeable)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
h = np.array([
  int(i) for i in input().split()])

highest = np.array(
  [max(h[:i]) if i>0 else 0
   for i in range(len(h))])

print(np.sum(h>= highest))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

for i in range(1,len(a)) :
  if max(a[:i]) <= a[i]:
    r +=1
  else:
    continue
print(r)

Submission status: Accepted

Solution code:
import sys


N = int(sys.stdin.readline())

H = list(map(int, sys.stdin.readline().split()))

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

print(count)

Submission status: Accepted

Solution code:
def main():
    result = sub()
    print(result)


def sub():
    n = int(input())
    heights = [int(x) for x in (input().split())]
    count = 0

    maxHeight = 0
    for index, item in enumerate(heights):
        if item >= maxHeight:
            count = count + 1
            maxHeight = item
    return count


if __name__ == '__main__':
    main()

Submission status: Accepted

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

cnt = 1
for i in range(1, len(H)):
    h = H[i]
    h_ = H[:i]
    if h >= max(h_):
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

hs = list(map(int, input().split()))
maxs = [0] * (n + 1)

m = 0
for i in range(n):
    m = max(m, hs[i])
    maxs[i + 1] = m

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

print(count)

Submission status: Accepted

Solution code:
N = [int(s) for s in input().split(" ")][0]
Hs = [int(s) for s in input().split(" ")]
print(len([0 for i in range(1, N) if all([Hs[i] >= Hs[j] for j in range(i)])]) + 1)

Submission status: Accepted

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

first = H[0]
ret = 0
for it in H:
    if it >= first:
        ret += 1
        first = it
print(ret)

Submission status: Accepted

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

hmax = 0
cnt = 0
for h in H:
    if hmax <= h:
        hmax = h
        cnt += 1

print(cnt)

Submission status: Accepted

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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, str(input()).split()))
max_height = 0
count = 1
for i in range(1, n):
  max_height = max(max_height, h[i-1])
  count += (h[i] >= max_height)
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[:i]):
        ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
height=list(map(int,input().split()))
cont=1
temp=height[0]

for i in range(n):
	if i!=0 and height[i]>=temp:
		cont+=1
		temp=height[i]
print(cont)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
tmp = [1] * n

for i in range(0, n):
    for j in range(i, n):
        if h[i] > h[j]:
            tmp[j] = 0
print(tmp.count(1))

Submission status: Accepted

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

Submission status: Accepted

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

good = 0
for i in range(n):
  if i == 0:
    good += 1
  else:
    left = max(mountains[0:i])
    if left <= mountains[i]:
      good += 1
print(good)

Submission status: Accepted

Solution code:
N = int(input())
hotel = list(map(int, input().split(" ")))
ans = 0
hight = hotel[0]

for j in range(N):
    if hight <= hotel[j]:
        ans += 1
        hight = hotel[j]

print(ans)

Submission status: Accepted

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

ans = 1
highest = H[0]

for i in range(2, N + 1):
    Hi = H[i - 1]
    if Hi < highest:
        continue
    elif Hi >= highest:
        highest = Hi
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
AtCoder B
"""

def main():
    N=list(map(int,input().split()))
    H=list(map(int,input().split()))
    
    max_h=0
    num=0
    for h in H:
        if max_h<=h:
            max_h=max(max_h,h)
            num+=1
    print(num)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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