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: Wrong Answer

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 N == 1:
        print(cnt)
        sys.exit()
    if H[0]<=H[1]:
        cnt+=1        
        if N == 2:
            print(cnt)
            sys.exit()
    for n in range(2, N):
        if max(H[0:n-1])<=H[n]:
            cnt+=1
    print(cnt)
 
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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-1]) else 0
print(count)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

n = ni()
h = na()

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


print(c)

Submission status: Wrong Answer

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

count = 1

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

print(count)

Submission status: Wrong Answer

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

for i in range(1,N):
	if H[i] >= H[i-1]:
		cnt += 1
print(str(cnt)+'\n')

Submission status: Wrong Answer

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 N == 1:
        print(cnt)
        sys.exit()
    if H[0]<=H[1]:
        cnt+=1        
        if N == 1:
            print(cnt)
            sys.exit()
    for n in range(2, N):
        if max(H[0:n-1])<=H[n]:
            cnt+=1
    print(cnt)
 
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = int(input())

B = input().split()
C = int(B[0])
x = 1 
for i in B:
  y = int(i)
  if C < y:
    x += 1
  
print(x)

Submission status: Wrong Answer

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

print(h)
max = 0

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

print(count, "\n")

Submission status: Wrong Answer

Solution code:
N = int(input())
hotels = [int(i) for i in input().split()]
count = 0
max_height = 0
for i in range(len(hotels)):
    if i == 0:
        count += 1
        max_height = hotels[0]
    else:
        if hotels[i] > max_height:
            count += 1
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

    maxHeight = max(H)
    counter = 1
    for i, v in enumerate(H):
        if i == 0:
            continue
        if v < maxHeight:
            counter += 1
        elif v == maxHeight:
            break

    for i, v in enumerate(H):
        if i == 0:
            continue
        if v == maxHeight:
            counter += 1

    print(counter)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

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

print(h)
max = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
maxIndex = [i for i, x in enumerate(a) if x == max(a)]
c = a[:maxIndex[-1]+1]
while(c.index(min(c)) > 0):
  del c[c.index(min(c))]
print(len(c))

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

if N == 1:
    print(1)
    exit()

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: Wrong Answer

Solution code:
N = int(input())
H = list(input())
ans = 1
for i in range(1,len(H)):
  if H[i-1]<=H[i]:
    flag = 0
    for j in range(i):
      if H[i]<H[j]:
        flag=1
    if flag != 1:
      ans+=1
print(ans)

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

Solution code:
mt_count=int(input())
heights = list(map(int, input().split()))
count = 1
heights.reverse()
for i in range(len(heights)-1):
  check_flag = 1
  for j in range(len(heights)-1):
    if heights[i] < heights[j+1]:
      check_flag = 0
  if check_flag == 1:
    count += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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
        else:
            ans=ans+1 
        # print(h[j])
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def split_returner(chardata):
        chardata = str(chardata).split(" ")
        for i in range(0,len(chardata)):
            chardata[i] = int(chardata[i])
        return chardata
higher = input()
ab = split_returner(str(input()))
result = 1
for i in range(1,len(ab)):
    if ab[i] >= ab[0] and ab[i] >= ab[i-1]:
        result+= 1
    else:
        pass
print(result)

Submission status: Wrong Answer

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

ans = 1
hmax = H[0]

for i in range(1, N):
    if hmax <= H[i]:
        hmax = H[i]
    else:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

print(h)
max = 0

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

print(count)
print()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = 1
b = list()
for i in range(N-1):
    if H[i+1] - H[i] > 0:
        a += 1
    else:
        break
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(h)
max = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
a=int(input())
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: Wrong Answer

Solution code:
n=int(input())
#s=input()
#a,b=map(int,input().split())
#A=[list(map(int,input().split()))for i in range(n)]
h=list(map(int,input().split()))
a=h[0]
cnt=1
for i in range(1,n):
    if h[i-1]<=h[i] and a<=h[i]:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(2,N):
    if a[i] >= max(a[0:(i)]):
        res +=1
    
print(res)

Submission status: Wrong Answer

Solution code:
a = input()
b = list(map(int, input().split(' ')))
mae = 0
res = 0
for hei in b:
    if hei >= mae:
        res = res + 1
    else:
        break
    mae = hei
print(res)

Submission status: Wrong Answer

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

ans = 0
if N == 1:
  ans = 0
else:
  h1 = H[0]
  h2 = H[1]
  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: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

res=0

Hmax = max(H)
Hmax_idx = 0
for idx,h in enumerate(H):
    if h>=H[0]:
        res+=1

    if h == Hmax:
        Hmax_idx = idx
        break

if Hmax_idx+1 < N:
    for i in range(idx+1,N):
        if H[i] >= Hmax:
            res+=1

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

h1 = H[0]
cnt = 1
for h in H[1:]:
  if h1 <= h:
    cnt += 1
  h1 = h
print(cnt)

Submission status: Wrong Answer

Solution code:

N = int(input())
h = map(int,input().split())
H = []
for c in h:
    H.append(int(c))
print(H)

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


n = raw_input()                                    

ar = []                                            
h = raw_input().split()                            

cnt = 0                                            
m = 0
for i in h:
    if (i >= max(m, i)):                           
        cnt += 1                                   
        m = i

print cnt

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

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 N == 1:
        print(cnt)
        sys.exit()
    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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
a=map(int, raw_input().split())
ans=0
for i in range(n):
  if i == sum([a[j]<a[i] for j in range(i)]): ans+=1
print ans

Submission status: Wrong Answer

Solution code:
n=int(input())
#s=input()
#a,b=map(int,input().split())
#A=[list(map(int,input().split()))for i in range(n)]
h=list(map(int,input().split()))
a=h[0]
cnt=1
for i in range(1,n):
    if h[i-1]<h[i] and a<=h[i]:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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

for i in range(1, n):
    no_flag = 0
    for j in range(i-1):
        if h[j] > h[i]:
            no_flag = 1
        else:
            pass
    if no_flag == 0:
        total += 1

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
"""
python3 a.py < input.txt
"""
import math
import itertools as it
import heapq

N=int(input())
H=list(map(int,input().split()))
n=0
print(len([hi for i,hi in enumerate(H) if i == 0 or (i == 1 and H[0] < hi) or ( i > 1 and max(H[:i]) <= hi)]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

max_H = H[0]
L = [1 for i in range(N)]
for i in range(1, N):
    if H[i] > max_H:
        L[i] = 1
    else:
        L[i] = 0
    max_H = max(H[i], max_H)

print(sum(L))

Submission status: Wrong Answer

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

first = H[0]
ret = 0
for it in H:
    if it >= first:
        ret += 1
print(ret)

Submission status: Wrong Answer

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


L = [1 for i in range(N)]
for i in range(1, N):
    if H[i] > H[i-1]:
        L[i] = 1
    else:
        L[i] = 0

print(sum(L))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
p=input().split()
k=[]
for i in p:k.append(int(i))
c=1
for i in range(1,n):
    if i == 1:
        if k[1] >= k[0]:
            c+=1
        continue
    m=max(k[0:i-1])
    w=k[i]
    if m <= w:c+=1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

m=0
num = 0
for h in H:
    if h>=m:
        num +=1
        m=h

print(num)

Submission status: Wrong Answer

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

ans = 0
max = 0
for i in h:
    if i > max:
        max = i
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
test = list(map(int,input().split()))
counter = 1
    
for i in range(1,len(test)):
    if test[i] >= test[i-1]:
        counter += 1
        
print(counter)

Submission status: Wrong Answer

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

view = 0
cnt = 0
for i in range(n):
  if hotels[i] > view:
    cnt += 1
    view = hotels[i]
    
print(cnt)

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N = _I()
H = LI()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N = _I()
H = LI()

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Time Limit Exceeded

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

while n < m:
 if a[n] < max(a[0:n]):
  D=D
 else:
  D=D+1

print(D)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
List=list(map(int,input().split()))
c =1
i =1
while i < a:
    if i-1 == 0:
        if List[i-1] < List[i]:
            c +=1
            i +=1
print(c)

Submission status: Time Limit Exceeded

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


while True:
    for i in range(n):
        for j in range(i-1):
            if h[i]<h[j]:
                break
        a+=1

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 1

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

result = 0
for i, x in enumerate(a):
  flg = True
  
  for c in a[:i]:
    flg = flg and c <= x
  
  if flg:
    result += 1

print(result)

Submission status: Accepted

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

cn = 1
L = []

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

print(cn)

Submission status: Accepted

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

ans = 0
highest = 0
for height in h:
    highest = max(height, highest)
    if height >= highest:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import math


def main():
    n = int(input())
    # a, b = map(int, input().split())
    h = list(map(int, input().split()))
    # s = input()
    # h = [int(input()) for _ in rane(n)]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

count = 1
max_height = height[0]

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

print(count)

Submission status: Accepted

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

count = 0
max_val = 0
for x in h:
    if max_val <= x:
        count += 1
        max_val = x
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
highest = 0
for i in h:
    if highest <= i:
        ans += 1
        highest = i

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
input = lambda: stdin.readline().rstrip()
n = int(input())
h = list(map(int, input().split()))
max_h = h[0]
ans = 1
for i in range(1, n):
    if h[i] >= max_h:
        ans += 1
        max_h = h[i]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int,input().split()))
m = 0
cnt = 0
for l in L:
  if m <= l:
    m = l
    cnt += 1
print(cnt)

Submission status: Accepted

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