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 = input().split()
c = 1
aux = False
h = list(map(int, h))
for i in range(1,n):
    for j in range(i - 1, -1, -1):
        if h[j] <= h[i]:
            aux = True
        else:
            aux = False
            break
    if aux:
        c = c + 1
        aux = 0

print(c)

Submission status: Accepted

Solution code:
n = int(input())
pousadas = [int(x) for x in input().split()]
maior = 0
cont = 0
for i in pousadas:
    if (maior - i) <= 0:
        cont += 1
        maior = i
print(cont)

Submission status: Accepted

Solution code:
line = input()
line = input()
numbers = [int(n) for n in line.split()]
predicted_value = 0
for i in range(len(numbers)):
    is_smaller = False
    for k in range(i):
        if numbers[i] < numbers[k]:
            is_smaller = True
            break
    if not is_smaller:
        predicted_value += 1
print(predicted_value)

Submission status: Accepted

Solution code:
k = int(input())
line = input()

m = []
am = 1
for n in range(k):
    m.append(int(line.split()[n]))
    if(n==0):
        tallest = m[n]
    if(n>0):
        tallest = max(m[n], tallest)
        coef = m[n] - tallest
        if(coef>=0):
            am+=1
print(am)

Submission status: Accepted

Solution code:
n = int(input())

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

mx = xs[0]
count = 0
for x in xs:
    if x >= mx:
        count += 1
        mx = x

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
mnt = int(input())
list_of_heght = [int(i) for i in input().split()]
# 海を見れる旅館の数
num_of_hotel = 1
idx =1
for i in list_of_heght[1:]:
    tmp = list_of_heght[0:idx]
    if max(tmp) <= i:
        num_of_hotel += 1
    idx += 1
print(num_of_hotel)

Submission status: Accepted

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

count = 1
for i in range(1,n):
  subh = sorted(h[0:i+1])
  if h[i]==subh[-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(1,N):
  n = len([1 for x in H[0:i] if x>H[i]])
  if n==0:
    count = count + 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c = 0
for i in range(N):
  h = H[i]
  T = "Y"
  for j in range(i):
    if h < H[j]:
      T = "N"
  if T == "Y":
    c +=1
print(c)

Submission status: Accepted

Solution code:
N = int(input())
L = [i for i in map(int,input().split())]
t = 0
res = 0
for i in range(len(L)):
    for j in range(i):
        if L[j] > L[i]:
            t = 1
            break
    if t==0:
        res += 1
    t = 0
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
n = int(input())
ary1 = list(map(int,input().split()))
print(len(reduce(lambda a, b: a+[b] if a[-1]<= b else a, ary1[1:],[ary1[0]])))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

N = ii()
H = li()

cnt = 0

for i in range(N):
    flag = 1
    for j in range(i):
        if H[i] < H[j]:
            flag = 0
            break
    if flag:
        cnt += 1
    
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input()) # 入力が1つ
# map(int, input().split()) # 入力が複数
m = [int(i) for i in input().split()] # 配列で数字

ans = 1
MAX = m[0]
for i in range(1, n):
    if m[i] >= MAX:
        ans += 1
    MAX = max(MAX, m[i])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
height_list = input().split()
int_height = []
for i in range(a):
    b = int(height_list[i])
    int_height.append(b)

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


print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Hmax=H[0]
count=0

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# python 3.4.3
import sys
input = sys.stdin.readline
import numpy as np

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


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

ans = 0
highest = 0

for h in H:
    if h >= highest:
        ans += 1
        highest = h

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, *h = map(int, open(0).read().split())
m = h[0]
for i in range(n):
    if m > h[i]:
        n -= 1
    m = max(m, h[i])
print(n)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    N = int(input())
    H = [0] + input_nums()
    maxh = H[0]
    cnt = 0
    for i in range(1, N+1):
        if maxh <= H[i]:
            maxh = H[i]
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import sys
n = int(input())
h = np.array([int(x) for x in input().split()])
ans = 0
m = h[0]
for i in range(n):
	if m <= h[i]:
		ans += 1
		m = h[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  n = int(input())
  H = list(map(int,input().split()))
  cnt = 1
  for i in range(1,n):
    flag = True
    for j in range(0,i+1):
      if H[j] > H[i]:
        #print(i,j)
        flag = False
        break
    if flag:cnt+=1
  print(cnt)
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
N = int(input())
H = [int(h) for h in input().split()]
count = 0
for i in range(N):
    can_see = True
    for j in range(i):
        if H[j] > H[i]:
            can_see = False
            break
    if can_see:
        count += 1

print(count)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    n =int(input())
    a = [int(i) for i in input().split()]
    max = 0
    count =0
    for i in a:
        if max <= i:
            count+=1
            max = i

    print(count)

Submission status: Accepted

Solution code:
n = int(input())
H = [int(x) for x in input().split()]
m = -1
cc = 0
for h in H:
  cc += (h >= m)
  m = max(h, m)
print(cc)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

count = 0
maximum = 0

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

N = int(input())

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
H = iil()
ans = 0
high = H[0]
for item in H:
    if item >= high:
        ans += 1
    high = max(item,high)
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 = count + 1
print(count)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
H = np.array(input().split(), dtype=np.int32)

H_cummax = np.maximum.accumulate(H)
answer = (H_cummax == H).sum()
print(answer)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

maxh = 0
cumH = [0]
for i in range(n):
    maxh = max(maxh, H[i])
    cumH.append(maxh)

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

Submission status: Accepted

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

x = H[0]
ma = 0
ct = 0

for Hi in H:
    
    if ma < Hi:
        ma = Hi
    if Hi >= ma:
        ct += 1

print(ct)

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    hs=LIST()
    ct=0
    for i in range(n):
        if max(hs[0:i+1])==hs[i]:
            ct+=1
    print(ct)
if __name__ == '__main__':
    do()

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1, n):
    if h[i] > high:
        high = h[i]
    diff = h[i] - high
    if diff >= 0:
        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())
Hi = list(map(int,input().split()))

count = 0
done = [0]
for h in Hi:
  done.append(h)
  if h >= max(done):
    count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, *a = map(int, open(0).read().split())
mx = cnt = 0
for i in a:
  if mx<=i:
    cnt += 1
    mx = i
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
H = LIST()

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

print(view_hotel)

Submission status: Accepted

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

m = 0
ans = 0
for i in h:
    if m <= i:
        ans += 1
        m = i
print(ans)

Submission status: Accepted

Solution code:
import sys

n=int(input())
h=list(map(int,input().split()))
count=0
be=h[0]
maxcount=h.count(max(h))
becount=0

for i in range(n):
  if be<=h[i] and h[0]<=h[i]:
    if becount<=h[i]:
      if h[i]==max(h):
        maxcount-=1
        count+=1
        becount=h[i]
        if maxcount==0:
          print(count)
          sys.exit()
      else:
        count+=1
        becount=h[i]
    else:
      pass
  be=h[i]
  
print(count)

Submission status: Accepted

Solution code:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
n = int(input())
arrH = list(map(int,input().split()))

hight = 0
ans = 0
for i in range(n):
    if arrH[i]>=hight:
        ans +=1
    hight = max(hight,arrH[i])

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  #s = input()
  #s = input().split()
  h = list(map(int,input().split()))
  #c = [input().split() if i in range(n)]
  ans = 0
  a = 0
  
  for i in range(n):
    if a <= h[i]:
      ans += 1
      a = h[i]
  print(ans)
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

x = 1
for i in range(1, n):
    f = True
    for j in range(i):
        if hh[j] > hh[i]:
            f = False
            break
    if f:
        x += 1
print(x)

Submission status: Accepted

Solution code:
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
    else:
        pass
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

lmx = 0
count = 0
for i in range(n):
    if H[i] >= lmx:
        count += 1
        lmx = H[i]
print(count)

Submission status: Accepted

Solution code:
n=int(input())
h=[int(i) for i in input().split()]
count=n
for i in reversed(range(1,n)):
    for j in reversed(range(0,i)):
        #print(count)
        #print(h[i],h[j])
        if h[i]<h[j]:
            count-=1
            break
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

num = 0
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
_list = [0] * 100
ans = 0

for i in range(n):
    _list[h[i]-1] += 1
    if sum(_list[h[i]:]) == 0:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input().strip())
H_list = list(map(int, input().rstrip().split()))
#-----

max_H=0
cnt=0
for i in H_list:
    if i >= max_H:
        cnt += 1
        max_H = i

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    hs = list(map(int, input().split()))
    lower = float("-inf")
    ans = 0
    for h in hs:
        lower = max(lower, h)
        if lower <= h:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=input().split()
s=0
num=0
#print(a)
for i in range(n):
    if int(a[i])>=s:
        num+=1
        s=int(a[i])
print(num)

Submission status: Accepted

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

ans = 0
MAXH = 0
for h in H:
    if h >= MAXH:
        ans += 1
        MAXH = h

print(ans)

Submission status: Accepted

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

base=H[0]
count=1

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

Submission status: Accepted

Solution code:

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

highest = h[0]
ans = 0

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

print(ans)

Submission status: Accepted

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

high = 0
cnt = 0
for mountain in H:
    if high <= mountain:
        high = mountain
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
res = 0
for i in range(n):
    res += all(j <= a[i] for j in a[:i])
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
H = list(map(int, input().split()))
ans = 1
maxH = H[0]

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