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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
list = []
list = input().split()
M = 1
for i in range(1, N):
  k = list[i]
  t_list = [0:i+1]
  a_list = sorted(t_list, reverse=True)
  if a_list[0] == k:
    M += 1
    
print(M)

Submission status: Runtime Error

Solution code:
N = int(input())
list = []
list = input().split()

M = 1

for i in range(1, N):
　　k = list[i]
　　t_list = list[0:i+1]
　　a_list = sorted(t_list, reverse=True)
　　if a_list[0] == k:
　　　　M += 1
print(M)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
totalnum = int(input())
ryohight = int(input()).split(" ")
nd = 0
for nd in range(totalnum):
  nd += 1
  if nd == 0:
    lst[nd] = lst.append(ryohight[0])
  elif int(ryohight[nd]) >= int(lst[nd-1]):
      lst[nd] = ryohight[nd]
print(len(lst))

Submission status: Runtime Error

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


def can_get_ocean_view(subheights):
    return 1 if max(subheights) == subheights[-1] else 0


def count_hotels_with_ocean_view(heights):
    hotels_with_ocean_view = [can_get_ocean_view(heights[:i]) for i in range(1, len(heights)+1)]
    return sum(hotels_with_ocean_view)


print(count_hotels_with_ocean_view(heights))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


def can_get_ocean_view(subheights):
    return 1 if max(subheights) == subheights[-1] else 0


def count_hotels_with_ocean_view(heights):
    hotels_with_ocean_view = [can_get_ocean_view(heights[:i]) for i in range(1, len(heights)+1)]
    return sum(hotels_with_ocean_view)


print(count_hotels_with_ocean_view(heights))

Submission status: Runtime Error

Solution code:
N=int(input())

list=[]
for i in range(N):
     list.append(int(input()))
a = 0
for k in range(N):
    list_n = []
    for i in range(k+1):
        list_n.append(list[i])
    if list[k] == max(list_n):
        a = a + 1
    else:
        pass  
print(a)

Submission status: Runtime Error

Solution code:
a=input()
b=input()

b=b.split(" ")
count=1

for x in range(len(b)-1):
    for i in range(len(b)-1):
        if b[x]<=b[x+1]:
            m=m+1
    if m==len(b)-1:
        count=count+1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
heights = [input().split() for _ in range(N)]


def can_get_ocean_view(subheights):
    return 1 if max(subheights) == subheights[-1] else 0


def count_hotels_with_ocean_view(heights):
    hotels_with_ocean_view = [can_get_ocean_view(heights[:i]) for i in range(1, len(heights)+1)]
    return sum(hotels_with_ocean_view)


print(count_hotels_with_ocean_view(heights))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
r_count=int(input())
m_height=list(map(int, input().rstrip().split()))
len(m_height)==r_count
a=0
for i in range(r_count):
    if (m_height[i] if len(m_height)>i) < (m_height[i-1] if len(m_height)>(i-1)):
        a=a+0
    else:
        a=a+1
print(a)

Submission status: Runtime Error

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

tmp = []
for i in range(1, len(H)):
    tmp.append(all(H[:i]<=H[i]))
print(sum(tmp)+1)

Submission status: Runtime Error

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

tmp = []
for i in range(1, len(H)):
    tmp.append(all(H[:i]<=H[i]))
print(sum(tmp)+1)

Submission status: Runtime Error

Solution code:
N = int(input())
list = []
for i in range(N):
  list.append(int(input()))

M = 1


for i in range(1, N):
  k = list[i]
  t_list = list[0:i+1]
  a_list = sorted(t_list, reverse=True)
  if a_list[0] == k:
    M += 1

print(M)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
H = raw_input().split()

tmp = []
for i in range(1, len(H)):
    tmp.append(all(H[:i]<=H[i]))
print(sum(tmp)+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())

list=[]
for i in range(N):
     list.append(int(input()))
#print(list)
a = 0
for k in range(N):
    list_n = []
    for i in range(k+1):
        list_n.append(list[i])
       #print(l_even)
    #print(max(list_n))
    if list[k] == max(list_n):
        a = a + 1
    else:
        pass
print(a)

Submission status: Runtime Error

Solution code:
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    for k in range(i):
        out = False
        if k >= 0:
            print(ListH[k],ListH[i])
            if ListH[k] < ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans_index = [0]
if h[1] >= h[0]:
    ans_index.append(1)
for i in range(2, n):
    if h[i] >= max(h[:i]):
        ans_index.append(i)
# print(ans_index)
print(len(ans_index))

Submission status: Runtime Error

Solution code:
N = int(input())

h = []
for i in range(N):
    h = list.append(int(input()))

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

print(count)

Submission status: Runtime Error

Solution code:
h = int(input())
mount = [int(_) for _ in input().split()]
count = 0
for i in range(h):
  if i == 0
    count += 1
  else:
    for j in range(i):
      if mount[i]<mount[j]:
        break
    else:
      count += 1
print (count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
H = np.array(map(int, input().split()))
tmp=[]
for i in range(len(H)-1):
    tmp.append(all([all(H[:i]<=[H[i]]), all([H[i]]<=H[i+1:])]))
#print(sum(tmp))
print(1)

Submission status: Runtime Error

Solution code:
n=input()
h = list(map(int,input().split()))
h1 = h[0]
hi = h[-1]
hi2 = h[-2]
count = 0
for takasa in h:
    if takasa >= h1:
        count+= 1
if hi2 > hi:
    count -= 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
H = np.array(map(int, input().split()))
tmp=[]
for i in range(len(H)-1):
    tmp.append(all([all(H[:i]<=[H[i]]), all([H[i]]<=H[i+1:])]))
print(sum(tmp))

Submission status: Runtime Error

Solution code:
n = int(input())

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

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

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
H = np.array(map(int, input().split()))
H = np.array([1,2,3,4,5])
tmp=[]
for i in range(len(H)-1):
    tmp.append(all([all(H[:i]<=[H[i]]), all([H[i]]<=H[i+1:])]))
print(sum(tmp))

Submission status: Runtime Error

Solution code:
n = int(input())

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

max = 0
for i in n:
    if max <= h[i]:
        max = h[i]
        count += 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
H = input().split()
maxH = H[0]
look = 1
for i in range(N-1):
	if N == 1:
    	print(1)
	elif H[i+1] >= maxH:
    	look = look + 1
    	maxH = H[i+1]
  	else:
    	maxH = maxH
print(look)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
H = np.array(map(int, input().split()))
tmp=[]
for i in range(len(H)-1, -1, -1):
    tmp.append(all([all(H[:i]<=[H[i]]), all([H[i]]<=H[i+1:])]))
print(sum(tmp))

Submission status: Runtime Error

Solution code:
inn_num = int(input())
if inn_num >= 1 and inn_num <= 20: 
    inn_height = [int(input()) for i in range(inn_num)]
    
count = 0
for h in inn_height:
    if h >= inn_height[0]:
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
N = 3
H = np.array(map(int, input().split()))
tmp=[]
for i in range(len(H)-1, -1, -1):
    tmp.append(all([all(H[:i]<=[H[i]]), all([H[i]]<=H[i+1:])]))
print(sum(tmp))

Submission status: Runtime Error

Solution code:
n=int(input())
list=[int(x) for x in input().split()]
a=0
for j in range(n):
  if max(list[:j])<=list[j]:
    a=a+1
  else:
    pass
print(a)

Submission status: Runtime Error

Solution code:
N = int(input())
H = np.array(map(int, input().split()))
H = list(H)
tmp=[]
for i in range(len(H)-1, -1, -1):
    tmp.append(all([all(H[:i]<=[H[i]]), all([H[i]]<=H[i+1:])]))
print(sum(tmp))

Submission status: Runtime Error

Solution code:
h = int(input())
mount = [int(_) for _ in input().split()]
count = 0
for i in range(h):
  if i = 0:
    count += 1
  else:
    if mount[i]>mount[i-1]:
      count += 1
print (count)

Submission status: Runtime Error

Solution code:
n=int(input())
list=[]
for i in range(n):
  list.append(int(input())
a=0
for j in range(n):
  if max(list[:j])<=list[j]:
    a=a+1
  else:
    pass
print(a)

Submission status: Runtime Error

Solution code:
n=int(input())
h_list=[int(i) for i in input().split()]
b = 1  # counter
c = 1  # answer
m = h_list[0]  # max height
while b != (n - 1):
    if h_list[b] > m:
        c += 1
    b += 1
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
a.append(int(i) for i in input().split())  
ans = 0
m = a[0]
for i in range(n-1):
  if m <= a[i+1]:
    ans += 1
    m = a[i+1]
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
list=[]
for i in range(n):
  list=list.append(int(input())
a=0
for j in range(n):
  if max(list[:j])<=list[j]:
    a=a+1
  else:
    pass
print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h = int(input())
mount = [int(_) for _ in input().split()]
count = 0
for i in range(len):
  if i = 0:
    count += 1
  else:
    if mount[i]>mount[i-1]:
      count += 1
print (count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
list=[int(input()) for x in range(n)]
a=0
for j in range(n):
  if max(list[:j])<=list[j]:
    a=a+1
  else:
    pass
print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
H = map(int, input().split())
#H = list(H)
tmp=[]
for i in range(len(H)-1, -1, -1):
    tmp.append(all([all(H[:i]<=H[i]), all(H[i]<=H[i+1:])]))
print(sum(tmp))

Submission status: Runtime Error

Solution code:
n=int(input())
list=[int(input()) for x in range(n)]
a=0
def m(list,k):
  t=max(list[:k])
  return t
for j in range(n):
  if m(list,j)<=list[j]:
    a=a+1
  else:
    pass
print(a)

Submission status: Runtime Error

Solution code:
n=int(input())
list=[int(input()) for x in range(n)]
a=0
def max(list,k):
  t=max(list[:k])
  return t
for j in range(n):
  if max(list,j)<=list[j]:
    a=a+1
  else:
    pass
print(a)

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    for idx in range(1, n):
        diff = [h_n[idx] - h_n[i] for i in range(0, idx-1)]
        diff = filter(lambda x: x >= 0, diff)

    print(len(list(diff)) + 1)
    
main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a =input()
N, H=a.split(\n)
H=H.split()

def hoge(N,H):
    ar = 0
    for i in H:
        if i >= asr:
            count += 1
            ar = i
    return count

def main():
    hoge(N,H)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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


tmp=[]
for i in range(len(H)-1, -1, -1):
    tmp.append(all([all(H[:i]<=H[i]), all(H[i]<=H[i+1:])]))
print(sum(tmp))

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    for idx in range(1, n):
        diff = [h_n[idx] - h_n[i] for i in range(0, idx-1)]
        print(diff)
        diff = filter(lambda x: x >= 0, diff)

    print(len(list(diff)) + 1)
    
main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
def B():
    N = input()
    H = [int(i) for i in input().split()]
    max_high = max(H)
    max_index = H.index(max_high)

    count = 0
    count += H.count(max_high)

    pmax = H[0]
    for i in range(max_index):
        if pmax <= H[i]:
            pmax = H[i]
            count += 1
        
    print(count)
    
   
  if __name__ == '__main__':
    B()

Submission status: Runtime Error

Solution code:
N= input()
highs = input().split()
count = 1
for i in range(1, len(highs)):
    if highs[i] >= max(highs[0:i]):
        count += 1
print(count\n)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

n=int(input())
h=list()
count=1
for i in range(n):
  h.append(int(input()));
  if i==1:
    max=h[i-1]
  else:
    if h[i-1]>=max:
      max=h[i-1]
      count++
print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

count = 0
for i in range(len(HList)) :
    if i == 0 :
        count += 1
    elif HList[i] >= stn and HList[i] >= HList[i-1] :
        count += 1
        if stn > HList[i] :
            stn = HList[i]

print(count + "\n")

Submission status: Runtime Error

Solution code:
import sys

n=input()
h=list()
count=1
for i in range(n):
  h.append(input());
  if i==1:
    max=h[i]
  else:
    if h[i]>=max:
      max=h[i]
      count++
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
Hs = list(map(int, input().split()))
print(len([i for i in range(0, len(Hs)) if all(lambda j: Hs[j]<=Hs[j+1]), range(0, i)]))

Submission status: Runtime Error

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

count = 0
for i in range(len(HList)) :
    if i == 0 :
        count += 1
    elif HList[i] >= stn and HList[i] >= HList[i-1] :
        count += 1
        if stn > HList[i] :
            stn = HList[i]

print(count)

Submission status: Runtime Error

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

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

    print(counter)


if __name__ == '__main__':
    main()



if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = input()
a = list(map(int, input().split()))
print(sum(max(x[:i] <= x[i] for i in range(n))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input().strip())
arrayH = list(map(int, input().strip().split(' ')))
ans = 1
i = 0
while arrayH[i] <= arrayH[i+1]:
                ans = i + 1
                i = i + i
                if i == N - 1:
                        break
print(ans)

Submission status: Runtime Error

Solution code:
x=int(input())
li = list(map(int,input().split()))
i=0
c=0
a=0
for n in li:
  while c<i:
    if li[c]>n:
      break
    c+=1
    if c=i:
      a+=1
  c=0  
  i+=1
print(a)

Submission status: Runtime Error

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: Runtime Error

Solution code:
hpi = input()
k = list(map(int, input().split(" ")))
for c in range(int(hpi) - 1):
  jo = "yes"
  n = k[:c + 2]
  for co in range(len(n) - 1):
    if n[co] > k[c]:
      jo = "no"
    else:
      pass
  if jo == "yes":
    count += 1
print(count + 1)

Submission status: Runtime Error

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

count = 0
for i in range(len(HList)) :
    if i == 0 :
        count += 1
    elif (HList[i] >= stn and HList[i] >= stn2) and HList[i] >= HList[i-1] :
        count += 1

print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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 = mount_height
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
H = list(map(int, input().split(" ")))
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: Runtime Error

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
        cunt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
H_list = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 1
if H_list[1] >= H_list[0]:
    cnt += 1

for i in range(2, N):
    if H_list[i] >= max(H_list[:i-1]):
        cnt += 1

print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=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: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())

pattern1 = A+A-1
pattern2 = A+B
pattern3 = B+B-1

print(max(pattern1, pattern2, pattern3))

Submission status: Runtime Error

Solution code:
n=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: Runtime Error

Solution code:
n = int(input())
h_list = [int(input()) for h in range(n)]

count = 0
last_h = 0
for index,h in enumerate(h_list):
	if last_h <= h:
		count += 1
	
	if last_h < h:
		last_h = h

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
n = input()
h = input().split()

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

Submission status: Runtime Error

Solution code:
a=int(input())
k=[]
for i in range(a):
  k.append(int(input()))
l =1
for i in range(1,a):
  for j in range(i):
    if k[i] >= k[j]:
      l += 1
print(l)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 09:52:55 2019

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy
import bisect

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

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

def main():
    cnt = 1
    if H[0]<=H[1]:
        cnt+=1
    for n in range(2, N):
        if max(H[0:n-1])<=H[n]:
            cnt+=1
    print(cnt)
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

_count=1
max_height=H[0]

for i in range(1,N):
    if max_height <= H[i]:
        count +=1
        max_height = H[i]
print(_count)

Submission status: Runtime Error

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

ans = 0
for i in range(1,N):
  if H[i] >= h1 and H[i] >=h2 and H[i] >= H[i-1]:
    ans += 1
    
print(ans+1)

Submission status: Runtime Error

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

first = H[0]
for i, h in enumerate(H[1:]):
    if first > h:
        break
    first = h
print(i+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
count=0
for i in range(k):
  j=int(input())
  a.append(j)
  if max(a)<=j:count+=1
print(count)

Submission status: Runtime Error

Solution code:
#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) { os << p.first << " " << p.second; return os; }

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; }return false; }
template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int N; cin >> N;
	vector<int>v(N); rep(i, 0, N) { cin >> v[i]; }
	int ans = 0;
	int h = 0;
	rep(i, 0, N) {
		if (h <= v[i])ans++;
		chmax(h, v[i]);
	}
	cout << ans << endl;

	return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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