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 = list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

prev = 0
ret = 0
for h in hh:
    if prev <= h:
        ret += 1
    else:
        pass

    prev = max(prev, h)

print(ret)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def count_hotels(n, hs):
    res = 1 + sum(all(hs[j] <= hs[i] for j in range(i)) for i in range(1, n))
    return res


def main():
    n = int(input())
    hs = [int(h) for h in input().split()]
    print(count_hotels(n, hs))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, copy
input = sys.stdin.readline
N = int(input())
H = [int(x) for x in input().split()]
max, ans = H[0], 1
for i in range(1,N):
    if max <= H[i]:
        ans += 1
        max = H[i]
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import re, sys

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

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

print(count)

Submission status: Accepted

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

count = 0
high_max = 0

for high in H:
	if high_max <= high:
		count += 1
		high_max = high

print(count)

Submission status: Accepted

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

max_H = H[0]
L = [1 for i in range(N)]
for i in range(1, N):
    if H[i] >= max_H:
        L[i] = 1
    else:
        L[i] = 0
    max_H = max(H[i], max_H)

print(sum(L))

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(m) for m in input().split()]

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

Submission status: Accepted

Solution code:
from sys import exit

N = int(input())

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=input().split(' ')
h=[]
for i in range(0,n):
	h.append(int(s[i]))
count=1
for i in range(1,n):
	my=h[i]
	highest=max(h[0:i])
	if my >= highest:
		count=count+1

print(count)

Submission status: Accepted

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

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

print(int(res))

Submission status: Accepted

Solution code:
n=int(input())
p=input().split()
k=[]
for i in p:k.append(int(i))
c=1
for i in range(1,n):
    if i == 1:
        if k[1] >= k[0]:
            c+=1
        continue
    m=max(k[0:i])
    w=k[i]
    if m <= w:c+=1
print(c)

Submission status: Accepted

Solution code:
n=int(input())  #数値入力
list_h=list(map(int, input().split()))  #リスト入力

score  = 1
for i,h in enumerate(list_h[1:]):
    score += (max(list_h[:i+1]) <= h) * 1
print(score)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

print ans

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

h_list = list(int(i) for i in input().split())

ans = 1

for i in range(1, N):
    can_view = True
    for j in range(i):
        if h_list[j]>h_list[i]:
            can_view = False
    if can_view:
        ans+=1

print(ans)

Submission status: Accepted

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

buf = 0
for i,r in enumerate(rs):
	flg = 0
	for j in range(0,i):
		if(rs[i] < rs[j]):
			flg = 1
		else:
			pass
	if flg == 0:
		buf = buf + 1
print(buf)

Submission status: Accepted

Solution code:
N = int(input())
H = map(int, input().split())
highest = 0
ans = 0
for height in H:
    if height >= highest:
        ans += 1
        highest = height
print(ans)

Submission status: Accepted

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

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

max_h = 0
number = 0
for h in h_list:
    if h >= max_h:
        max_h = h
        number += 1

print (number)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = [int(i) for i in input().split()] 
c,max = 1,a[0]

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

Submission status: Accepted

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

N = int(input())
H = map(lambda x: int(x), input().split(' '))

maxH = 0
result = 0
for h in H:
    if h >= maxH:
        result += 1
        maxH = h
print(result)

Submission status: Accepted

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

ans = 0
m = hs[0]
for h in hs:
  if m <= h:
    ans += 1
  m = max(m, h)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    N = int(input())
    H = map(int, input().split())

    cnt = 0
    max_ = 0
    for i in H:
        if max_ <= i:
            cnt += 1
            max_ = i
    print(cnt)

input = lambda: stdin.readline()
main()

Submission status: Accepted

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

c = 0
mh = H[0]
for h in H:
	if mh <= h:
		c += 1
		mh = max(mh, h)
	else:
		continue
print(c)

Submission status: Accepted

Solution code:
# coding:utf-8

def main():
    N = int(input())
    mountain = input().split()
    #print(mountain)
    ans = 0
    mountain_max = -1
    for i in range(N):
        if mountain_max <= int(mountain[i]):
            mountain_max = int(mountain[i])
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import numpy as np
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()))
M = 0
count = 0
for i in range(n):
  if M <= h[i]:
    count += 1
    M = h[i]
print(count)

Submission status: Accepted

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

cnt=0
teppen=h[0]
for i in range(n):
    if teppen<= h[i]:
        cnt+=1
        teppen=h[i]
    else:
        continue
print(cnt)

Submission status: Accepted

Solution code:
#coding: utf-8
N = int(input())
h = list(map(int, input().split()))
cnt = 1
for i in range(1, N):
    tmp = 0
    for j in range(i+1):
        if h[j] > h[i]:
            tmp += 1
    if tmp == 0:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect, math
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]
H = read_int()

def solve():
    ans = 1
    mh = H[0]
    for i in range(1, N):
        cansee = True
        for j in range(0, i):
            if H[j] > H[i]:
                cansee = False
                break
        if cansee:
            ans += 1
    return ans

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

Submission status: Accepted

Solution code:
N = int(input())
H = [int(i) for i in input().split()]
ans = 0
l = 0
for x in H:
    if l <= x:
        ans += 1
        l = max(l, x)
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[j]>H[i]:
            flag=False
    if flag:
        count+=1 
print(count)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    mountain_count = int(input())
    mountains = list(map(int, input().split()))
    ans = 0
    for i in range(mountain_count):
        can_watch = True
        for j in range(mountain_count):
            if i == j:
                break
            if mountains[i] < mountains[j]:
                can_watch = False
                break
        if can_watch:
            ans += 1
    print(ans)

Submission status: Accepted

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

maxH = 0;
count = 0;
for i in range(N):
    if maxH <= A[i]:
        count+= 1
    maxH = max(maxH, A[i])


print(count)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
top = 0
for i in range(N):
    if arr[i] >= top:
        ans += 1
        top = arr[i]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
H = [int(h) for h in input().split()]
ans = 1
isView = False
for i in range(1,n):
    tmp = H[i]
    for j in H[:i]:
        if j > tmp:
            isView = False
            break
        else:
            isView = True
    if isView:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:


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

Submission status: Accepted

Solution code:
n = int(input())
mount = list(map(int, input().split()))
count =1
for i in range(1,n):
    for j in range(0,i):
        if mount[i] >= mount[j] and j != i-1:
            continue
        elif mount[i] >= mount[j] and j == i-1:
            count+=1
        else:    
            break
print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
lst = list(map(int,input().split()))
low_mountain = lst[0]
count= 0
for i in lst:
    if i >= low_mountain:
        low_mountain = i
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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


def solv(n, h):
    top = 0
    ans = 0
    for hi in h:
        if top <= hi:
            top = hi
            ans += 1
    return ans


if __name__ == '__main__':

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

    ans = solv(n, h)

    print(ans)

Submission status: Accepted

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

k = 0
ans = 0
for h in hl:
    if h >= k:
        ans += 1
        if h > k:
            k = h

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

mountains = [0]

can_see = 0

for H in Hs:
    mountains.append(H)
    if H == max(mountains):
        can_see += 1

print(can_see)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
mx=H[0]
count=0
for i in H:
    if mx<=i:
        mx=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):
    lh = max(h[0:i])
    if h[i] >= lh:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
from collections import defaultdict
from collections import Counter
from collections import OrderedDict
#key = {1:2, 2:5, 3:5, 4:4, 5:5, 6:6, 7:3, 8:7, 9:6}
N = int(input())
#H = (int(i) for i in input().split())
#H = (int(input().split()))
H=list(map(int, input().split()))  #リスト入力
#print(H)
cnt = 0
for i, h in enumerate(H):
    if i == 0:
        max_h = H[0]
        cnt += 1
        continue
    else:
        if max_h <= h:
            cnt += 1
            max_h = h
print(cnt)

Submission status: Accepted

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

sum=1
for i in range(1, n):
        flag = True
        for j in range(0, i):
                if(h[j] > h[i]):
                        flag = False
        if(flag):
                sum+=1
print(sum)

Submission status: Accepted

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


def solve(N: int, H: "List[int]"):
    ans = 1
    h = H[0]
    for i in range(1, len(H)):
        if(H[i] >= h):
            ans += 1
            h = H[i]

    print(ans)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    H = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, H)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

count = 1
max = h[0]
f = 0
if n == 1:
    print(count)
    f = 1
else:
    for i in range(1,n):
        if h[i] >= max:
            count += 1
            max = h[i]
        
if f == 0:
    print(count)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
hotel = list(map(int, input().split()))

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

print("{0}".format(count))

Submission status: Accepted

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

from sys import stdin
    
def calc(ryokans):
    ans = 0
    _max = -1

    for x in ryokans:
        if x >= _max:
            ans += 1
            _max = x

    return ans

def main():
    n = stdin.readline().rstrip()
    ryokans = [int(x) for x in stdin.readline().rstrip().split()]
    ans = calc(ryokans)
    print(ans)
    
if __name__=='__main__':
    main()

Submission status: Accepted

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

height = h[0]
ans = 0

for i in h:
  if height <= i:
    ans += 1
    height = i
  
print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

score = 0
asdf = []
for i, mt in enumerate(mts):
    asdf.append(mt)
    if max(asdf) == asdf[i]:
        score += 1
print(score)

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
max_h = m[0]
count = 0

while i < n:
  if m[i] >= max_h:
    count += 1
  max_h = max(max_h, m[i])
  i += 1
  
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
H = [int(c) for c in input().split()]
nvisible=0
for i,hi in enumerate(H):
    visible=1
    for hj in H[:i]:
        if hj>hi:
            visible=0
            break
    nvisible+=visible
print(nvisible)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(i) for i in input().split()]
ans = 1
for i, hi in enumerate(H[1:]):
    i += 1
    f = True
    for h in H[:i]:
        if h > hi:
            f = False
    if f:
        ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

print(count)

Submission status: Accepted

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


def load_input():
    n = int(input())
    h = list(map(int, input().split()))
    return n, h


def main():
    n, h = load_input()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

highest = 0
count = 0

for h in H_list:
    if h >= highest:
        count += 1
        highest = h

print(count)

Submission status: Accepted

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

s = 0
a = 0
for i in h:
    if i >= a:
        a = i
        s +=1

print(s)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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)):
  hotel=h[i]
  c=True
  for j in range(0,i):
    if h[i]<h[j]:
      c=False
      break
  if c:
    cnt+=1
print(cnt)

Submission status: Accepted

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

ans = 0
max_ = 0
for i in h:
    if i >= max_:
        ans += 1
        max_ = i
print(ans)

Submission status: Accepted

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

max_h = 0
count = 0
for i, h_i in enumerate(H):
    if max_h <= h_i:
        max_h = h_i
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input().rstrip())
H = list(map(int, input().rstrip().split()))
a = H[0]
can = [1]
for i in range(1, N):
    if a > H[i]:
        continue
    elif a < H[i]:
        a = H[i]
        can.append(i+1)
    else:
        can.append(i+1)
print(len(can))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def is_large(h_main, hs):
    if len(hs) == 0:
        return True

    for h in hs:
        if h_main < h:
            return False
    return True


ans = 0
for i, H in enumerate(Hs):
    if is_large(H, Hs[:i]):
        ans += 1
print(ans)

Submission status: Accepted

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

max = 0
count = 0
for i in xrange(len(H)):
    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()))
max_h = h[0]
ans = 1
for i in range(n-1):
    if h[i+1] >= max_h:
        ans += 1
        max_h = h[i+1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
maximum = 0
for i in H:
    if maximum <= i:
        count += 1
        maximum = i

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in h:
  if i >= m_h:
    cnt += 1
  m_h = max(m_h,i)

print(cnt)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
current_h = hs[0]
for h in hs[1:]:
    count += 1 if h >= current_h else 0
    current_h = max(current_h, h)
print(count)

Submission status: Accepted

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

ans = 0

i = 0
j = 0
while i < len(H):
    j = i
    isOK = True
    while j >= 0:
        if H[i] < H[j]:
            isOK = False
            break
        j -= 1
    if isOK:
        ans += 1
    i += 1

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

# print(n, h)

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

print(count)

Submission status: Accepted

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

max_tmp = 0
ans = 0
for i, h in enumerate(H):
    if h >= max_tmp:
        ans += 1
        max_tmp = h

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

cnt = 1
flag = True
for i in range(1, N):
    mount = lst[i]
    flag = True
    for j in range(0, i):
        if lst[j] > mount:
            flag = False
            break
    if flag == True:
        cnt = cnt + 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

sum = 1

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

print(sum)

Submission status: Accepted

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

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

top = 0
count = 0
for x in H:
    if top <= x:
        count += 1
        top = x

print(count)

Submission status: Accepted

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