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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
 
def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))
 
    ans = 0
    H = A[0]
    for a in A:
        if a >= H:
            ans += 1
 
        H = max(H, a)
 
    return ans
 
 
if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

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

tmp = H[0]
ans = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B

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

count = 0
maxh = 0
for i in H:
    if i >= maxh:
        count += 1
        maxh = i
        
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

cou = 1 
high = [a[0]]

for i in range(n-1):
    mmhigh = max(high)
    aa = a[i + 1]
    
    if mmhigh <= aa:
        high.append(aa)
        cou += 1
    else:
        pass
      
print(cou)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
l=0
s=0
for i in map(int,input().split()):
  if i >=l:
    l=i
    s+=1
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

H_i = input().split()
H_i = [float(n) for n in H_i]

ocean_view_count = 0

for i in range(N):
   if max(H_i[:i+1]) == H_i[i]:
       ocean_view_count += 1
     
print(ocean_view_count)

Submission status: Accepted

Solution code:
N = int(input())
N_lis = [int(i) for i in input().split()]
count,hi = 0,N_lis[0]
for i in N_lis:
        if hi <= i:
            count +=1
            hi = i

print(count)

Submission status: Accepted

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

for i in l:
    if i >= max:
        max = i
        count += 1

print(count)

Submission status: Accepted

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

n = 0
for i in range(N):
  for h in H[:i]:
    if h > H[i]:
      break
  else:
    n += 1
      
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

v = sum(1 for i in range(N) if max(H[:i], default=0) <= H[i])
print(v)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
#処理 i番目のHがそれ以前以上の高さか調べる
for i in  range(N):
    l = H[:i+1]
    if max(l) == H[i]:
        ans += 1

#出力
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
mx = 0
count = 0
st = input()
for i in range(N):
  if mx <= int(st.split()[i]):
    count += 1
    mx = int(st.split()[i])
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = input().split()
max_height = 0
count = 0

for j in range(N):
    if int(H[j]) >= max_height :
        count = count + 1
        max_height = int(H[j])

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#ABC124 B
N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(N):
    if i==0:
        pass
    else:
        i_bool = True
        for j in range(1,i+1):
            if H[j-1] > H[i]:
                i_bool = False
        if i_bool:
            ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
mount_list = list(map(int, input().split()))
max_hight = 0
ryokan = 0
for i in range(len(mount_list)):
    if max_hight<= mount_list[i]:
        max_hight = mount_list[i]
        ryokan+=1

print(ryokan)

Submission status: Accepted

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

count = 0
H_max = 0

for Hi in H:
    if H_max <= Hi:
        count += 1
        H_max = Hi

print(count)

Submission status: Accepted

Solution code:
import sys,math
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().split()))
sea = [True]*N
for i in range(N):
    if i >=1:
        if all([H[i] >= H[j] for j in range(i) ] ):
            sea[i] = True

        else:
            sea[i] = False
ans = sum(sea)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Great Ocean View

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

answer = 1

if N == 1:
  print(answer)

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

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())
H = [int(i) for i in (input()).split(" ")]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
b=c=0
for h in map(int,input().split()):
    if b<=h:
        b=h
        c+=1
print(c)

Submission status: Accepted

Solution code:
#abc124b

n=int(raw_input())
h=map(int,raw_input().split())
mh=h[0]
cnt=1
for i in xrange(1,n):
 if h[i]>=mh:
  mh=h[i]
  cnt+=1
print cnt

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

#B
N=int(input())
H =[int(j) for j in input().split()]
cnt=0
for i in range(len(H)):
    if max(H[0:i+1]) <= H[i]:
        cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(0,N):
    flag = True
    for t in range(0,i):
        #print(t)
        if b[t] > b[i]:
            flag = False
            break
    if flag == True:
        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 H[i] + 1  > max(H[: i + 1]):
           ans +=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(int,input().split()))
t = s[0]
c = 1

for i in range(n - 1):
    if s[i+1] >= t:
        t = s[i+1]
        c += 1

print(c)

Submission status: Accepted

Solution code:
N = input()
Hs = input().strip().split(' ')
ans = 0;
H = 0;
for i in Hs:
  i = int(i)
  if (i >= H):
  	ans += 1
  H = max(H, i)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
H=map(int, input().split())
k=0
j=0
for num in H:
    if num>=k:
        j=j+1
        k=num
print(j)

Submission status: Accepted

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

count_ans = 1
tmp = H[0]
for ii in range(1,len(H)):
    if tmp < H[ii]:
        tmp = H[ii]
        count_ans += 1
    elif tmp == H[ii]:
        count_ans += 1

print(count_ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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+1])==a[i]):
        count+=1

print(count)

Submission status: Accepted

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

n_pos = 0
max_c = 0
for i in c:
    if i>=max_c:
        n_pos += 1
        max_c = i
    else:
        pass
print(n_pos)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
max_height = -1

for h in H:
    if h >= max_height:
        count += 1
        max_height = h

print(count)

Submission status: Accepted

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

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] >= max:
        count += 1
        max = H[i]

print(count)

Submission status: Accepted

Solution code:
N=int(input())

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

ans = 0

for ind in range(len(lis)):
  flag = True
  if ind == 0:
    ans += 1
    continue
  for j in range(ind):
      if lis[j] > lis[ind]: 
        flag = False
  if flag:
    ans +=1  
print(ans)

Submission status: Accepted

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

counter = 0

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

Submission status: Accepted

Solution code:
def calc(x):
    global mount
    global list
    count=0
    for y in range(1,x+1):
        if mount[x] >= mount[x-y]:
            count+=1
    if x == count:
        list.append(x)

N=int(input())

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

list=[]

for z in range(1,len(mount)):
    calc(z)

print(1+len(list))

Submission status: Accepted

Solution code:
N = int(input())

lis = list(map(int,input().split()))
ans = 0
flag = lis[0]
for x in lis:
    if flag > x:
        continue
    ans += 1

    if flag < x:
        flag = x
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 1
for i in range(N-1,0,-1):
    subcount = 0
    for j in range(1,i+1):
        if H[i] >= H[i-j]:
            subcount += 1
        else:
            break
    if subcount == i:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
high = h[0]
ans = 1
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())
list_mountain_height = list(map(int, input().split()))

count_ocean_view = 0

for i in range(len(list_mountain_height)): 
	count = -1
	for k in list_mountain_height[:i+1]:
		if k > list_mountain_height[i]:
			break
		else:
			count += 1
	if count == i:
		count_ocean_view += 1
	else:
		continue

print(count_ocean_view)

Submission status: Accepted

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

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

max_ = y[0]
point = 0
for i in y:
  
  if i >= max_:
    point += 1
    max_ = i
  
print(point)

Submission status: Accepted

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

ans = 0
m = -1
for hh in h:
    if hh >= m:
        ans += 1
        m = hh
print(ans)

'''
自分より左の最大値とだけ比較すればよいので、
最大値を更新して、比較する
'''

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
#import math
#n=int(input())
#li=input().split()
#S=input()

n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in range(1,n):
    a=0
    for j in range(i):
        if lis[i]>=lis[j]:
            a+=1
        else:
            break
    if a==i:
        ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(len(H)):
  chkflg = True
  if i >= 1:
    for j in range(i): 
      if H[j] > H[i]:
        chkflg = False
        break

  if chkflg: ans += 1

print(ans)

Submission status: Accepted

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


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

print(ans+1)

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_:
        ans += 1
        max_ = H[i]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
HList = [int(i) for i in input().split(" ")]
stn = -1
count = 0

for i in range(len(HList)) :
    if HList[i] >= stn  :
        count += 1
    if stn < HList[i] :
        stn = HList[i]

print(count)

Submission status: Accepted

Solution code:
import numpy as np
#入力
N = input()
A = input()
#入力値を取り出す
B = np.array(list(map(int,A.split( ))))
ans = 1
for i in range(1, len(B)):
    if(len(B[0:-i][B[0:-i] > B[-i]])>0):
        ans = ans
    else:
        ans = ans + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
list_h = raw_input().split()
h = [int(s) for s in list_h]
count = 1
max_h = h[0]

for i in range(1, n):
 if h[i] >= h[i-1] and h[i] >= max_h:
  count += 1
  max_h = h[i]
print count

Submission status: Accepted

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

tmp = 0
count = 0
for i in range(N):
  if tmp <= a[i]:
    count += 1
    tmp = a[i]
    
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(len(H)):
  chkflg = True
  if i >= 1:
    for j in range(i): 
      if H[j] > H[i]:
        chkflg = False
        break

  if chkflg: ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
hight = list(map(int,input().split()))
cnt = 1
maxd = hight[0]

for i in range(n-1):
    if maxd <= hight[i+1]:
        cnt = cnt +1
        maxd = hight[i+1]
    else:
         continue
        
print(cnt)

Submission status: Accepted

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

res = 1
for i in range(1,n):
	ll=li[:i]
	if max(ll)<=li[i]:
		res = res + 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

c = 1
maxc = ar[0]
for a in ar[1:]:
    if a >= maxc:
        c += 1
        maxc = a

print(c)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
H = list(map(int, input().split()))
max_h = 0
count = 0

for h in H:
    if h >= max_h:
        max_h = h
        count += 1
print(count)

#H_max = np.amax(H)
#H_max_index = np.argmax(H)

Submission status: Accepted

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

ma = 0
ans = 0
for h in H:
    if ma <= h:
        ans += 1
        ma = h

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

max_h = 0
cnt = 0
for h in H:
    if h >= max_h:
        max_h = h
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
curM = 0

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

for h in H:
    if h >= curM:
        ans += 1
    curM = max(curM, h)
print(ans)

Submission status: Accepted

Solution code:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
n=I()
H=IL()
m=0
c=0
for i in range(n):
  if H[i]>=m:
    c+=1
  m=max(m,H[i])
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input().split()
H = input().split()
number = 0
H = [int(v) for v in H]
def f(x):
    s = 0
    for j in range(x):
        if H[x] >=  H[j]:
            s += 1
            continue
        else:
            break
        break
    if s == x:
        global number
        number += 1

for i in range(int(N[0])):
    f(i)

print(number)

Submission status: Accepted

Solution code:
A = int(input())
N = input().split()
ans = 1
for i in range(A-1) :
    B = N[:i+1]
    if int(N[i+1]) >= int(max(B))  :
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
for i in range(N):
    j = 0
    while (i - j) >= 0:
        if i == j:
            count += 1
            break
        if H_LIST[i] < H_LIST[j]:
            break
        j += 1
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

def main():
	N = int(input())
	H = input().split(" ")
	H = [int(s) for s in H]
	

		



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

	
	
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
a = 1
for j in range(1, n):
    flag=False
    for i in range(0, j):
        if h[i] <= h[j]:
            flag = True
        else:
            flag = False
            break
    if flag:
        a = a + 1

print(a)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
count = 0
total = 0
H = []
s = input().split()

for i in range(N):
  H.append(int(s[i]))
  for j in range(i):
    if(H[i] >= H[j]):
      count = count + 1
  if(count == i):
    count = 0
    total = total + 1
  count = 0
    
print(total)

Submission status: Accepted

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

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

Submission status: Accepted

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

shr = A[0]
c = 1

for i in range(1, N):
      if A[i] >= shr:
              c += 1
              shr = A[i]

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = [int(_) for _ in input().split()]
Hlist = list(map(lambda x:x-H[0],H))
result = 1
compareValue = Hlist[0]
for i in range(N-1):
  if Hlist[i+1] >= compareValue:
    result += 1
    compareValue = Hlist[i+1]
print(result)

Submission status: Accepted

Solution code:
n = int(input())

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

output = 1

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

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

for num, hight in enumerate(h):
  if hight >= max(h[:num+1]):
    count += 1

print(count)

Submission status: Accepted

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

print(cnt)

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[:i]) <= h[i]:
    result += 1

print(result)