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

ans = 1

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


print(ans)

Submission status: Accepted

Solution code:
# ans

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

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

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

top=mou[0]
count=0

for i in range(N):
    if mou[i]>=top:
        count+=1
        top=mou[i]
    
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 0
cnt = 0
for i in range(n):
    if tmp <= lis[i]:
        cnt += 1
        tmp = lis[i]
        
print(cnt)

Submission status: Accepted

Solution code:
def actual(n, H):
    count = 0

    for i in range(len(H)):
        if i == 0:
            count += 1
            continue

        me = H[i]
        left_towers = H[:i]

        can_see_the_sea = all([h <= me for h in left_towers])
        count += int(can_see_the_sea)

    return count

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

print(actual(n, H))

Submission status: Accepted

Solution code:
import math
def ip():return int(input())
def inp():return map(int,input().split())
def inpstr():return map(str,input().split())
def linp():return list(map(int,input().split()))
def linpstr():return list(map(str,input().split()))

n=ip()
h=linp()
ans=1
for i in range (1,n):
    f=True
    for j in range(i):
        if h[i]<h[j]:f=False
    if f==True:ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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


def solve(N: int, H: "List[int]"):
    ma, ans = 0, 0
    for h in H:
        if ma <= h:
            ans += 1
            ma = h
    return ans


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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]"
    print(solve(N, H))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i=0
m=0

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

Submission status: Accepted

Solution code:
import numpy as np

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

    kosuu = 1
    for i in range(n):
        if i > 0:
            if h[i]>=h[i-1]:
                if h[i] >= np.max(h[0:i]):
                    kosuu += 1
    print(kosuu)
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    H = [int(h) for h in input().split()]
    ans = 1
    maxH = H[0]
    for i in range(1, N):
        if H[i] >= maxH:
            ans += 1
            maxH = H[i]
    print(ans)

    return  0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

max_h = 0
ans = 0
for i in range(len(h)):
    if h[i] >= max_h:
        ans += 1
        max_h = h[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

# main
ans = 0
for i in range(n):
  if max(H[:i+1]) == H[i]:
    ans += 1
  
# output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(sys.stdin.readline().rstrip())
H = list(map(int, sys.stdin.readline().rstrip().split()))
higest = 0
ans = 0
for h in H:
    if h >= higest:
        ans += 1
        higest = h
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
  t = max(t,H[i])
  if(t == H[i]):
    ans += 1
print(ans)

Submission status: Accepted

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

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

    print(ans)


resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

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

minHigh = 0
counter = 0
for high in Hn:
    if high >= minHigh:
        counter += 1
        minHigh = high


print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

max_height = []

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    H = list(map(int, input().split()))
    if N == 1:
        return print(1)
    CNT = 1
    High = H[0]
    for i in range(1,N):
        if H[i] >= High:
            CNT += 1
            High = H[i]
        
    return print(CNT)

if __name__ == '__main__':
    main()

Submission status: Accepted

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


resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
H = list(map(int, input().split()))
ans =0
for i in range(1,N):
    if max(H[:i+1]) ==H[i] :
        ans +=1
 
print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# check
ocean_view = 1
max = H[0]
for i in range(1, N):
    if max <= H[i]:
        ocean_view += 1
        max = H[i]

print(ocean_view)

Submission status: Accepted

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

now = 0
ans = 0
for h in High:
    if now <= h:
        ans += 1
        now = h
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans, max_height = 0, 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    H = lmi()
    cnt = 0
    current_max = -1
    for height in H:
        if height >= current_max:
            cnt += 1
            current_max = height
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

    return ans

if __name__ == '__main__':
    print(q2())

Submission status: Accepted

Solution code:
n=int(input())

h=[int(x) for x in input().split()]
cnt=1
for i in range(1,n):
    if h[i]>=max(h[:i]):
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
l = [str(h[0])]
for i in h[1:]:
        if i>=int(sorted(l)[-1]):
            i = str(i)
            l.append(i)
print(len(l))

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy

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

count = 0
maximum = 0
for i in range(n):
    maximum = max(maximum,h[i])
    if maximum <= 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):
    if h[i]>=max(h[:i]):
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def bit_count(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
H = inputIL()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
H=[int(_) for _ 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())
h = list(map(int,input().split()))

import numpy as np

h = np.array(h)

cnt =1
for i in range(1,n):
    
    flg=0
    for j in range(i):

        if h[j]>h[i]:
            flg+=1

    if flg==0:
        cnt+=1


print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


for i in range(int(n)):
    ok = 0
    if i!=0:
        for j in range(i):

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')
# ----------------------------------------------------------- #

n = I()
H = LI()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

H = list(input().split())
H = [int(H[i]) for i in range(N)]
count = 1

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

print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

cnt = 1

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

Submission status: Accepted

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

cnt = 1

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

Submission status: Accepted

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

Submission status: Accepted

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