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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ms=list(map(int,input().split(" ")))
ans=1
for i in range(n-1):
    check=list(filter(lambda x:x>ms[i+1],ms[:(i+1)]))
    if len(check)==0:
        ans+=1
print(ans)

Submission status: Accepted

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

h_list = []
count = 0
for h in H:
    h_list.append(h)
    h_max = max(h_list)
    if h >= h_max:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())
height_list = [int(i) for i in input().split(" ")]
is_see_count = 0
for i in range(n):
    if n == 0:
        is_see_count += 1
    else:
        height = height_list[i]
        for j in range(i):
            if not height >= height_list[j]:
                break
        else:
            is_see_count += 1
print(is_see_count)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    N = int(input())
    h_lst = [int(x) for x in stdin.readline().split()]
    lst = []
    count = 0
    for i in range(N):
        lst.append(h_lst[i])
        if h_lst[i] >= max(lst):
            count += 1
    print(count)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

maxh = 0
view = 0

for hh in h:
    if hh >= maxh:
        view += 1
        maxh = hh

print(view)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))  # 入力のときに N を使う必要はありません

highest = 0
cnt = 0
for h in H:
    if h >= highest:
        highest = h
        cnt += 1

print(cnt)

Submission status: Accepted

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

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

print(num)

Submission status: Accepted

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

Submission status: Accepted

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

height = 0
ans = 0

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

Submission status: Accepted

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

ans = 1
m = H[0]

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import os


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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

    ans = 1
    for i in range(1, N):
        ok = True
        for j in range(i):
            if H[j] > H[i]:
                ok = False

        ans += ok
            
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce

n = int(input())
h = list(map(int, input().split()))
# tuple型の一番目を参照
h_max = 0
count = 0

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

print(count)

Submission status: Accepted

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

ans = 0
tall = H[0]

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
m_list = list(map(int, input().split()))
max_num = 0
c = 0
for i in range(n):
  if m_list[i] - max_num >= 0:
    c += 1
    max_num = m_list[i]

print(c)

Submission status: Accepted

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

max_height=0
cnt=0
for height in h:
	if height>=max_height:
		cnt+=1
	max_height=max([max_height,height])

print(cnt)

Submission status: Accepted

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

max_ = 0
cnt = 0

for h in H:
  if h >= max_:
    cnt += 1
    max_ = h

print(cnt)

Submission status: Accepted

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

ans = 1
max_H = H[0]
for i in range(1, len(H)):
    if H[i-1] <= H[i] and max_H <= H[i]:
        max_H = H[i]
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
mountain = input()
viewpoint = input().split()
maxheight = 0
canview = 0

for i in range(0, int(mountain)):
    if maxheight <= int(viewpoint[i]):
        maxheight = int(viewpoint[i])
        canview += 1

print(canview)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [A[0]]
for i in range(N-1):
  B += [max(B[-1], A[i+1])]

ans = 0
for i in range(N):
  if A[i] == B[i]:
    ans += 1
    
print(ans)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
from collections import deque
N = int(input())
H = list(map(int, input().split()))
V = deque()
for i in range(len(H)):
    counter = 0
    for j in range(i):
        if H[i] >= H[j]:
            counter += 1
    if counter == i :
        V.append(H[i])
print(len(V))

Submission status: Accepted

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

a = 0
ans = 0

for i in H:
  if a <= i:
    a = i
    ans += 1
print(ans)

Submission status: Accepted

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

MAX = 0
count = 0

for X in H:
    if MAX <= X:
        MAX = X
        count += 1
print(count)

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 = input()
n = int(n)
lst1 = input().split()

h_mtn = 0
count = 0

for i in range(0, n, 1):
    state = lst1[i]
    state = int(state)
    if state >= h_mtn:
        count += 1
    if state > h_mtn:
        h_mtn = state

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def II(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def SI(): return input()
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')

N = II()
H_li = LI()

counter = 0
for i, H in enumerate(H_li):
    nolook = False
    for j in range(i+1):
        if H_li[j] > H: nolook = True
    if not nolook: counter+=1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h = [int(i) for i in input().split()]
x = 1
cnt = 1
mx = h[0]
while x < n:
  if h[x] >= mx:
    cnt += 1
    mx = h[x]
  x += 1
print(cnt)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
N = int(N)
str = input().split()
H = []
i = 0
j = 0
for i in range(N):
  H.append( int(str[i]) )
flag = 0
ans = 0
for i in range(N):
  for j in range(i):
    if H [i] < H[j]:
      flag =  1
      break
    else:
      flag = 0
  if flag == 0:
    ans = ans+1
  flag = 0

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
lista = [int(x) for x in input().split()]
maxi = 0
res = 0
for i in range (0, len(lista)):
  if lista[i]>=maxi:
    res+=1
    maxi = lista[i]
print(res)

Submission status: Accepted

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

for i in range(n):
    if highest <= h_list[i]:
        count += 1
        highest = h_list[i]

print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
def sub():
    N, Hs = [input() for _ in range(2)]
    Hs = [int(e) for e in Hs.split(" ")]
    count = 1
    maxH = Hs[0]
    for i in range(1, int(N)):
        h = Hs[i]
        if h >= maxH:
            count = count + 1
            maxH = h


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

sub()

Submission status: Accepted

Solution code:
n = int(input())

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

maxHeight = 0
count = 0

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

print(count)

Submission status: Accepted

Solution code:
from sys import stdin

def solve(n, hs):
    ans = 0
    max_height = hs[0]
    for i, height in enumerate(hs):
        if i == 0 or max_height <= height:
            ans = ans + 1
            max_height = height
    return ans


def main():
    lines = stdin.readlines()
    n = int(lines[0])
    hs = [int(n) for n in lines[1].split(' ')]
    ans = solve(n, hs)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = []
for i in range(len(b)):
    c = False
    for j in range(i):
        if b[i] < b[j]:
            c = True
    if c == False:
        d.append(i+1)

print(len(d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
mountain = [ int(s) for s in input().split(" ")]
ans = 0
highest = 0

for m in mountain:
    if m >= highest:
        ans += 1
        highest = m

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(h_list):
  ans = 0
  h_max = h_list[0]
  for h in h_list:
    if h >= h_max:
      ans += 1
      h_max = h

  return ans

def main():
  n = int(input())
  h_list = list(map(int, input().split()))
  
  ans = solve(h_list)
  print(ans)

main()

Submission status: Accepted

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

N=int(input())
heights = list(map(int,input().split()))  # N, H1, H2.... 複数行入力
ans = 0  # 一番左
max_height = heights[0]  # 一番西の建物が最大

for i in range(N):
    max_height = max(max_height,heights[i])
    if max_height == heights[i]:  # 更新
        ans += 1

print(ans)

Submission status: Accepted

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

count = 0
h = H[0]

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#Coding-Utf-8

N=int(input())
H=list(map(int, input().split()))
count=1
Num= H[0]

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

print(count)

Submission status: Accepted

Solution code:
n = input()

h = input()
h = h.split(' ')
h = [int(a) for a in h]

r = 0
max = h[0]
for tmp in h:
    if max <= tmp:
        r += 1
        max = tmp

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

peak = 0
ans = 0
for i in range(n):
  if lst[i] >= peak:
    peak = lst[i]
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
a=int(input())
h = list(map(int,input().split()))
c = 1
max_h = h[0]

for i in range(1, len(h)):
    if h[i] >= max_h:
        max_h = h[i]
        c += 1

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

max = 0
count = 0

for i in range(N):
    if list_H[i] >= max:
        max = list_H[i]
        count += 1
    elif list_H[i] < max:
        pass

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

necessary_height = a[0]
answer = 0
for i in range(n):
  if (a[i] >= necessary_height):
    answer += 1
    necessary_height = a[i]
    
print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

min_hight = 0
cnt = 0

for h in hs:
    if h >= min_hight:
        cnt += 1
        min_hight = h

print(cnt)

Submission status: Accepted

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

high = 0
count = 0

for bilding in l:
    if bilding > high:
        high = bilding
        count += 1
    elif bilding == high:
        count += 1
    else:
        pass
print(count)

Submission status: Accepted

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

now_max_height = 0
viewable = 0
for i in range(N):
    if Hs[i] >= now_max_height:
        viewable += 1
        now_max_height = Hs[i]
print(viewable)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N):
    if max(A[:i+1]) <= A[i]:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

counter = 1
max_num = H[0]

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

Submission status: Accepted

Solution code:
n = int(input())
h = [int(i) for i in 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())
li = list(map(int, input().split()))
mireru = []
highest = 0
for i in li:
    if i >= highest:
        mireru.append(1)
        highest = i
print(sum(mireru))

Submission status: Accepted

Solution code:
n = int(raw_input())
m = map(int, raw_input().split())
max_m = [0 for i in range(n)]
max_m[0] = m[0]
ans = 1
for i in range(1, n):
  if m[i] >= max_m[i - 1]:
    ans = ans + 1
    max_m[i] = m[i]
  else:
    max_m[i] = max_m[i - 1]
print ans

Submission status: Accepted

Solution code:
N = int(input())
H = list(input().split())
test = 0
count = 0
for i in range(N):
    if int(H[i]) >= test:
        count += 1
        test = int(H[i])
    else:
        pass

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    N = int(input())
    H = list(map(int, input().split()))
    
    count = 0
    highest = 0
    for index in range(N):
        if highest <= H[index]:
            highest = H[index]
            count += 1
            

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

count, max_h = 0, 0
for h in hs:
    if h >= max_h:
        max_h = h
        count += 1

print(count)

Submission status: Accepted

Solution code:
input()
number_list = list(map(int, input().split()))
count = 0
for i in range(len(number_list)):
    max_height = 0
    for j in range(i):
        max_height = max(max_height, number_list[j])
    if(max_height <= number_list[i]):
        count += 1
print(count)

Submission status: Accepted

Solution code:
a = int(input())
h = [int(i) for i in input().split()]
count = 0
for x in range(a):
 if h[x] >= max(h[:x+1]):
  count +=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = list(map(int, input().split()))
heights = list(map(int, input().split()))
view = 0

for i, height in enumerate(heights):
    if i==0:
        view +=1
    else:
        if height >= max(heights[0:i]):
            view +=1
        
    
print (view)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Great Ocean View
https://atcoder.jp/contests/abc124/tasks/abc124_b

"""
import sys


def solve(N, heights):
    max_height = -1
    res = []
    for h in heights:
        res.append(h >= max_height)
        max_height = max(max_height, h)
    return sum(res)


def main(args):
    N = int(input())
    heights = [int(h) for h in input().split()]
    ans = solve(N, heights)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

count = 1
bounds = H[0]

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

print(count)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    _ = int(stdin.readline().rstrip())
    Hs = [int(x) for x in stdin.readline().rstrip().split()]
    print(len([x for i, x in enumerate(Hs) if i == 0 or max(Hs[:i]) <= x]))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

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

res = 0
m = 0
for a in H:
    if m <= a:
        res += 1
    m = max(m, a)
print(res)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

count=[0]*N
count[0]=1

for ii in range(1,N):
    if H[ii] >= max(H[:ii]):
        count[ii]=1
    else:
        count[ii]=0
    
print(sum(count))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

m = a[0]
count = 1
for i in range(1, n):
    if a[i] > m:
        m = a[i]
        count += 1
    elif a[i] == m:
        count += 1

print(count)

Submission status: Accepted

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

# 各山のたかさを１個ずつみて
# その時点の最大値より高い山が出るたびにカウントアップ
cnt = 1  # H1は必ず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(" ")))
ans = 0
higher = 0

for i in H:
	if higher <= i:
		higher = i
		ans += 1

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0

# TODO: いろいろな人の関数名を参考にする
# h[0] ~ h[i-1]のなかで最大のhを取得
def get_max_h(i):
    max_h = 0
    if i > 0:
        max_h = max(h[:i])
    return max_h

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

print(sum)

Submission status: Accepted

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

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