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 = [int(i) for i in input().split()]
max_left = [0 for i in range(N)]
for i in range(1,N):
  max_left[i] = max(max_left[i-1], H[i-1])
res = 0
for i in range(N):
  if H[i] >= max_left[i]:
    res += 1
print (res)

Submission status: Accepted

Solution code:
num = int(input())
mtlist = [int(x) for x in input().split()]
mtmax = 0
view = 0

for i in range(num):
  if mtlist[i] > mtmax:
    mtmax = mtlist[i]
    view = view +1
  elif mtlist[i] == mtmax:
    view = view +1
  else:
    continue
    
print(view)

Submission status: Accepted

Solution code:
n=int(input())
li = list(map(int,input().split()))
cnt=0
for i in range(n):
    if li[i] == max(li[:i+1]):
        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):
    s=False
    for j in range(i):
        if h[i]>=h[j]:
            s=True
        else:
            s=False
            break
    if s==True:
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
NUM = int(input())

#print(NUM)


A = list(map(int,input().split()))
#print(A)


COUNT = 0
for i in range(NUM):
    PRECOUNT = 0
    
    for j in range(NUM-i):
        if A[NUM - i - 1] >= A[j]:
            PRECOUNT += 1
   
    if PRECOUNT == NUM-i:
        COUNT += 1
print(COUNT)

Submission status: Accepted

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

max_height = 0
counter = 0

for n in range(N):
    if max_height <= height_list[n]:
        counter += 1
        max_height = height_list[n]
        continue
print(counter)

Submission status: Accepted

Solution code:
N = int(input())
h_list = [int(i) for i in input().split()]
ans = 0
for i in range(N):
    h_i = h_list[i]
    for j in range(i+1):
        h_j = h_list[j]
        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()))
result = 1
h = H[0]

for i, h1 in enumerate(H):
    if i < len(H)-1:
        h2 = H[i+1]
    else:
        break
    if h <= h2 and h1 <= h2:
        h = h2
        result += 1

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(lst_len-1,0,-1):
    if(h_lst[i]>=h_lst[i-1] and h_lst[i]>=max(h_lst[:i])):
        ans += 1

print(ans)

Submission status: Accepted

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

max_h=0
count=0
for i in h_list:
    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()))
 
count = 0
for i, h in enumerate(H):
    if i == 0:
        count += 1
    elif i == 1:
        count += 1 if  H[1] >= H[0] else 0
    else:
        count += 1 if h >= max(H[:i]) else 0
print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

max_height = 0
count = 0

for i in range(n):
    num = int(nums_str_arr[i])
    if max_height <= num:
        count += 1
        max_height = num

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import io
import math
import re

datalist = input().split()
num_summit = int(datalist[0])

max_height = 0
num_available_site = 0

datalist = input().split()
for num in range(num_summit):
  height = int(datalist[num])
  if height >= max_height:
      max_height = height
      num_available_site += 1

print(num_available_site)

Submission status: Accepted

Solution code:
N=int(input())
ans=1
a=0
X=[int(i) for i in input().split()]
for i in range(1,N):
    check=True 
    for j in range(0,i):
        if(X[i]<X[j]):
            check=False
            continue
    if(check):
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

# In[19]:


import numpy as np


# In[49]:


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


# In[50]:


count = 1

for i in range(1,N):
    #print(i)
    if np.all(H[i] >= H[:i]):
        count += 1

print(count)


# In[ ]:

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
H = map(int, stdin.readline().rstrip().split())
i = 0
high = 0
for h in H:
    if not(h < high):
        i+=1
        high = h
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(num)

Submission status: Accepted

Solution code:
n = int(input())
*q, = map(int,input().split())
ans = [q[0]]
mh = q[0]
for i in range(1,n):
  if q[i] >= mh:
    ans.append(q[i])
    mh = q[i]
#print(ans)
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

ans = 1
maxH = HList[0]

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp = []
n = int(input())
ii = [int(f) for f in input().split()]
a = 1
for d in range(n-1):
    ff = ii[:d+1]
    ff.sort()
    if ff[d] <= ii[d+1]:
        a += 1
print(a)

Submission status: Accepted

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

result = 1
for i in range(1, N):
    if max(H[0:i + 1]) == H[i]:
        result += 1
    else:
        pass
print(result)

Submission status: Accepted

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

l = 0
res = 0

for h in H:
    if h >= l:
        res += 1
        l = h

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
N = int(input())
c = 1
H = list(map(int, input().split()))
for i in range(1,N):
    for j in range(i):
        if H[i] < H[j]:
            break
    else:
        c += 1
print(c)

Submission status: Accepted

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


k = 0
h = []

for i in range(N):
	h.append(H[i])
	if H[i] == max(h):
		k += 1
	else:
		k += 0

print(k)

Submission status: Accepted

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

ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
h = list(map(int, input().split()))
counter = 0
for i in h:
    if counter == 0:
        counter = counter + 1
        max_h = i
    else:
        if max_h <= i:
            counter = counter + 1
            max_h = i
        else:
            pass
print(counter)

Submission status: Accepted

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

for i in range(n):
    t = h[i]
    for j in range(i):
        if t < h[j]:
            break
    else :
        ans += 1

print(ans)

Submission status: Accepted

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

n = int(input())

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

count = 1

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0

for i, h in enumerate(_h):
    if i == 0:
        max_h = h
        ans = ans + 1
        continue
    
    if h < max_h:
        continue
    else:
        max_h = h
    
    if h >= _h[i-1]:
        ans = ans + 1

print(ans)

Submission status: Accepted

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

obstacle = []
obstacle.append(H[0])

ans = 1
for i in range(1,N):
  for j in obstacle:
    if j > H[i]:
      obstacle.append(H[i])
      break
  else:
    obstacle.append(H[i])
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
n=int(input());a=list(map(int,input().split()))
s=[]
l=0
for e in a:
  if len(s)>0:
    if all([e>=c for c in s]):
      l+=1
  s.append(e)
print(l+1)

Submission status: Accepted

Solution code:
N = input()
HH = [int(i) for i in input().split()]
Hmax = -1
k = 0
for H in HH:
    if H >= Hmax:
        k += 1
        Hmax = H
print(k)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
lista = list(map(int,input().split()))
count = 0

maxindex = lista[0]
for index in lista:
    if maxindex < index:
        maxindex = index
    if index >= maxindex:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
mountains = list(input().split())
mountains = [int(i) for i in mountains]
ans = 0
idx = 0
for i in mountains:
    if i == max(mountains[:idx+1]):
        ans += 1
    idx += 1

print(ans)

Submission status: Accepted

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

N=int(input())
H=list(map(int,input().split()))
m=H[0];c=0
for i in range(0,N):
  if (H[i]>=H[0])and(H[i]>=m):
    c+=1
    m=max(H[0],H[i])
print(c)

Submission status: Accepted

Solution code:
n = int(input())
l = input().split()
cnt = 0
max = 0
for i in l:
    if max <= int(i):
        max = int(i)
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

print(x)

Submission status: Accepted

Solution code:
N=int(input())
A = list(map(int, input().split()))
# for i in range(N):
#     a=map(int,input().split())
#     A.append(a) 

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

print(x)

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=input();*h,=map(int,input().split());p=h[0];c=1
for e in h[1:]:
 if e>=p:c+=1
 p=max(p,e)
print(c)

Submission status: Accepted

Solution code:
n = int(input())

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

mx,c = 0,0

for i in range(n):
	if(arr[i]>=mx):
		c += 1
		mx = arr[i]


print(c)

Submission status: Accepted

Solution code:
N=int(input())
X=[int(i) for i in input().split()]
ans=1
A=X.pop(0)
for i in X:
  if i >= A:
    ans+=1
    A=i
print(ans)

Submission status: Accepted

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

for mt in h:
    if mt >= highest:
        highest = mt
        counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(h)):
    for j in range(i + 1):
        if h[i] < h[j]:
            break
        if j == i:
            count += 1

print(count)

Submission status: Accepted

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

count = 1

for i in range(2, N+1):
    west_heights = h[1:i]
    if h[i] >= max(west_heights):
        count += 1

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import itertools

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

cnt = 0
prev_max_height = 0

for h in H:
    if prev_max_height <= h:
        prev_max_height = h
        cnt += 1

out = cnt

print(out)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c = 1
er = h[0]
for i in range(n - 1):
    if er <= h[i+1]:
        er = h[i+1]
        c += 1
print(c)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import itertools


def makeIntMatrix(lines):
    intMatrix = []
    for a in makeStringMatrix(lines):
        intMatrix.append([int(b) for b in a])
    return intMatrix
 
 
def makeStringMatrix(lines):
    stringMatrix = [line.split() for line in lines]
    return stringMatrix
 
 
def makeInt(line):
    return int(line.rstrip())
 
 
def makeMultiInteger(line):
    return [int(x) for x in line.rstrip().split()]


def solve(input_string):
    N = makeInt(input_string[0])
    t = makeMultiInteger(input_string[1])
    c = 0
    for i in range(N):
        if i == 0:
            c += 1
            continue
        elif t[i] >= max(t[:i]):
            c += 1
    return c


def main():
    input_lines = stdin.readlines()
    answer = solve(input_lines)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

m = -1

res = 0
for d in data:
    if d>=m:
        res+=1
    m = max(m,d)
print(res)

Submission status: Accepted

Solution code:
def main() -> None:
    N = int(input())
    H = [int(i) for i in input().split()]
    m = H[0]
    t = []
    ans = 0
    for i in range(0, len(H)):
        t.append(H[i])
        if max(t) <= H[i]:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
i=0
counter=0
saidai=0
while i<N:
    if saidai<=H[i]:
        saidai=H[i]
        counter=counter+1
    i=i+1
print(counter)

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

Submission status: Accepted

Solution code:
mount_count = input()
mount_heights = input()
mount_heights_list = mount_heights.split()
count = 0
max_height = int(mount_heights_list[0])
for mount_height in mount_heights_list:
    if max_height <= int(mount_height):
        max_height = int(mount_height)
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
inns = list(map(int, input().split()))
res = []

for k, v in enumerate(inns):
  res.append(all(list(map(lambda x: x <= v, inns[:k + 1]))))

print(res.count(True))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
#input
#N = 5
#H = [9,5,6,8,4]
N = int(input())
H = list(map(int,input().split()))
tmp = 0
for i in range(N):
    if H[i] == max(H[0:i+1]):
        tmp += 1

print(tmp)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(n):
  b = False
  for j in range(i):
    if hs[j] > hs[i]:
      b = True
  if not b:
    ss.append(i)
print(len(ss))

Submission status: Accepted

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

max = 0
c = 0

for h in hs:
    if h >= max:
        c += 1
        max = h

print(c)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
h = np.array(list(map(int, input().split())))

## 愚直にfor文組めばとりあえずすぐに解決できるけど...
count = 0
for i in range(1,N+1):
  mounts = h[:i]
  mounts_ = np.where(mounts<=h[i-1],0,1)
  if np.sum(mounts_) == 0:
    count += 1
print(count)

Submission status: Accepted

Solution code:
def main():
    n = int(input())

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

    hh = l[0]
    cnt = 0
    
    for i in l:
        if i >= hh:
            cnt += 1
            hh = i
    
    print(cnt)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
mountains = list(map(int, input().split()))
memo = 0
result = []
for m in mountains:
    if (m >= memo):
        memo = m
        result.append(m)
print(len(result))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
for i in range(1, len(H)):
    pred = [c <= H[i] for c in H[:i]]
    if all(pred):
        count += 1
        
print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
import sys
N = sys.stdin.readline()
N = int(N)

#print(N)
#for i in range(N):
H = sys.stdin.readline().split()
#print(H)

max_H = 0
cnt = 0
for i in range(len(H)):
    if(max_H<=int(H[i])):
#        print(H[i])
        max_H = int(H[i])
        cnt += 1
#    else:
#        print("m",max_H)
    
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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


acc = 0
maximum = h_list[0]
for n in h_list:
    tmp = n
    if maximum <= n:
        acc += 1
        maximum = n

print(acc)

Submission status: Accepted

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

res = 0
cum_max = 0
for i in range(N):
    cum_max = max(cum_max, H_list[i])
    if cum_max <= H_list[i]:
        res += 1
print(res)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def get_input():
    N = int(input())
    H = [int(_) for _ in input().split(" ")]
    return N,H

def solve(N,H):
    maximums = [max(H[:i+1]) for i in range(N)]
    count = 0
    for h,maximum in zip(H,maximums):
        if h>=maximum:
            count+=1
    return count 

if __name__ == "__main__":
    N,H = get_input()
    ans = solve(N,H)
    print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
s_data = stdin.readline().rstrip().split()
height = [int(itr) for itr in s_data]
ans = 1
for h in range(0,N):
    if h == 0:
        continue
    if height[h] >= max(height[:h]):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

ans = 1
for i,v in enumerate(l):
    for k in range(0,i):
        if l[k] > l[i]:
            break
        if k == i - 1:
            ans = ans + 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h = [int(x) for x in input().split()]
limit = h.pop(0)
result = 1
for height in h:
    if height >= limit:
        result += 1
        limit = height
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp_max = 0
update_cnt = 0
for i in range(0, N):
    if tmp_max <= H[i]:
        tmp_max = H[i]
        update_cnt += 1

print(update_cnt)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

height = 0
res = 0
for h in H:
    if h >= height:
        res += 1
    height = max(height, h)

print(res)

Submission status: Accepted

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

higest = 0
count = 0
for h in H_list:
    if h >= higest:
        higest = h
        count += 1
print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc124
# -*- coding: utf-8 -*-

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

current=0
cnt=0
for i in h:
    if i >= current:
        current = i
        cnt += 1

print(cnt)

Submission status: Accepted

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

max_h = 0
cnt = 0
for n in range(0, N):
    if Hs[n] >= max_h:
        max_h = Hs[n]
        cnt += 1
print(cnt)

Submission status: Accepted

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

for i in range(N):
  data.append(H[i])
  ma=max(data)
  if H[i]>=ma:
    count=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):
    result1 = max(H[:i])
    if H[i] >= result1:
        count += 1
print(count)

Submission status: Accepted

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

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

print(sum)