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 = list(map(int, input().split()))

ans = 1
if len(h) >= 2:
  if h[0] <= h[1]:
    ans += 1
  for i in range(2,n):
    isCount = True
    if h[0] <= h[i]:
      if h[1] <= h[i]:
      	for j in range(1,i):
          if h[j] > h[i]:
          	isCount = False
      	if isCount:
          ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
#input = open(sys.argv[1], "r").readline

def main():
    _ = int(input())
    H = list(map(int, input().split()))
    n = 0
    for i in range(len(H)):
        b = True
        for j in range(0,i):
            if H[i] < H[j]:
                b = False
                break
        if b:
            n += 1
    print(n)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

n = L[0]
ans = 0
for i in L:
    if i >= n:
        ans += 1
        n = i

print(ans)

Submission status: Accepted

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

    count = N

    for i in range(1, N):
        for k in range(i):
            if (H[k] > H[i]):
                count -= 1
                break

    print(count)


if __name__ == '__main__':
    func()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split(' ')))
result = 1
max_h = h[0]
for i in range(1, n):
    if max_h <= h[i]:
        result += 1
        max_h = h[i]
    else:
        continue

print(result)

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

Submission status: Accepted

Solution code:
n = int(input())
hs = [int(i) for i in input().split()]
flag = 1
for i in range(1,n):
    if all(hs[j] <= hs[i] for j in range(i)):
        flag = flag + 1
print(flag)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Hlist = tuple(map(int,input().split()))
counter = 0
for i,h in enumerate(Hlist,0):
    if h == max(Hlist[:i+1]):
        counter += 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
height = 0

for h in H:
    if h < height:
        continue
    else:
        count += 1
        height = h

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

m = 0
count = 0

for h in hs:
    if m <= h:
        count += 1
        m = h

print(count)

Submission status: Accepted

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

NH = 1
for i in range(N-1):
    if H[i+1] >= max(H[0:i+1]):
        NH = NH + 1
    else:
        NH = NH

print(NH)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
#import math #python 3.5~
import fractions #fractions.gcd() python~3.4
sys.setrecursionlimit(1000000)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

ma = arr[0]
cnt = 1

for i in range(1,n):
	if arr[i] >= ma:
		cnt += 1

	ma = max(ma, arr[i])

print (cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import logging
logging.basicConfig(level=logging.DEBUG)
logging.disable(logging.CRITICAL)

def main():
    N = int(input())
    H = list(map(int, input().split()))
    
    ans = 1
    for i in range(1, N):
        flag = 0
        for j in range(i):
            if H[i] < H[j]:
                flag += 1
            else:
                continue
        logging.debug('flag: {}'.format(flag))
        if flag == 0:
            ans += 1

    return ans

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#山の数
n = int(input())
#各山の高さ
h = list(map(int, input().split()))
cou = 1
for i in range(1, n):
    if not max(h[:i+1]) == h[i]:
        continue

    if not h[i-1] <= h[i]:
        continue

    cou+=1

print (cou)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1
max_n = n_list[0]

for i in n_list[1:]:
 if i >= max_n:
  max_n = i
  ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
r = 0
for h in h_seq:
    if h >= r:
        ans += 1
        r = h

print(ans)

Submission status: Accepted

Solution code:
def main():
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

highest_before = 0
score = 0

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

print(score)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    H = [int(h) for h in input().split()]
    max_h = 0
    count = 0
    for i in range(N):
        if H[i] >= max_h:
            count += 1
        max_h = max(max_h, H[i])
    return count

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
def test():
    n = int(input())
    a = list(map(int,input().split()))
    b = [a[0]]
    count = 1
    for i in range(1,n):
        for j in range(i):
            b.append(a[j])
        if all(x <= a[i] for x in b):
            count += 1

    print(count)


if __name__ == "__main__":
    test()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
# B - Great Ocean View(ABC124)
N=int(input())
H=list(map(int, input().split()))
C=0
for i in range(1,N+1):
    if max(H[:i])==H[i-1]:
        C+=1
print(C)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
r = 0
for h in h_seq:
    if h >= r:
        ans += 1
        r = h

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

count = 0
max_h = H[0]
for i in H:
    if i >= max_h:
        count += 1
        max_h = i

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
h = [int(x) for x in input().split()]
h2 = []
for i in range(n):
    if h[i] == max(h[:i+1]):
        h2.append(h[i])
print(len(h2))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,*h=map(int,open(0).read().split())

max_val = -float('inf')
cnt=0
for h_ in h:
  if max_val <= h_:
    cnt+=1
    max_val=h_
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import copy

inputa = input().split()
inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# a = inputa[0]
# inputList = list(a)

# x = int(inputb[0])
# y = int(inputb[1])

# inputList=[]
# for i in range(a):
#     inputNum = input()
#     inputList.append(inputNum)

b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

sum = 0
for i in range(len(b)-1, -1, -1):
    flg = True
    for j in range(i):
            if b[j] > b[i]:
               flg = False
               break
    if flg == True:
        sum += 1

print(sum)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h1=input().split()
h2=[]
for i in range(n):
    h2.append(int(h1[i]))

c=0
for i in range(n):
    if max(h2[:i+1])==h2[i]:
        c+=1

print(c)

Submission status: Accepted

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

H.reverse()

count = 0
for i in range(N):
    count_tmp = 0
    for j in range(i+1,N):
        if H[i] < H[j]:
            count_tmp += 1
            break
    if count_tmp == 0:
        count += 1

print(count)

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

num = 0
max1 = li[0]
for i in range(n):
    if li[i] >=max1:
        max1 = li[i]
        num += 1

print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

Solution code:
def solve():
    n = int(input())
    h = list(map(int, input().split()))
    return len([True for i in range(n) if h[i] == max(h[:i + 1])])


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

from collections import deque

N = int(input())
a = deque(list(map(int, input().split())))
tmp = 0
ctr = 0

for i in range(N):
    tmp = a.pop()
    if a == deque([]):
        ctr += 1
    elif max(a) <= tmp:
        ctr += 1
print(ctr)

Submission status: Accepted

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

Submission status: Accepted

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

max_height = 0
answer = 0

for i in range(n):
    if max_height <= h[i]:
        max_height = h[i]
        answer += 1

print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

# solve
ans = 1
for i in range(1, N):
    flag = True
    for j in range(i):
        if H[j] > H[i]:
            flag = False
    if flag:
        ans += 1

# output
print(ans)

Submission status: Accepted

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

def can_see_sea(i):
    hi = H[i]
    for h in H[0:i]:
        if h > hi:
            return False
    return True

count = 0

for i in range(N):
    if can_see_sea(i):
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

m = 0
a = 0

for i in range(n):
    if m<=h[i]:
        a+=1
        m=h[i]

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

count = 0
max_mount = -1
for i in range(len(Hs)):
    if max_mount <= Hs[i]:
        count += 1
        max_mount = Hs[i]

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8
def main():
    n = int(input())
    l = list(map(int, input().split()))
    count = 1

    #対象の山
    for i in range(1,n):
        view = True
        #比較される山
        for j in range(0,i):
            if l[j] > l[i]:
                view = False
        if view == True:
            count = count + 1

    print(count)

if __name__ == '__main__' :
    main()

Submission status: Accepted

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

Submission status: Accepted

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

M = H[0]
ans = 0
for h in H:
    if h < M:
        continue
    ans += 1
    M = h

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def solve(string):
    n, *h = map(int, string.split())
    count = 1
    for i in range(1, n):
        if max(h[:i]) <= h[i]:
            count += 1
    return str(count)


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

    h_max = max(h_max, h[i])

print(ans)

Submission status: Accepted

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

ans = 1
mx = H[0]

for i in range(1,N):
    if H[i]>=mx:
        ans +=1
        mx =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, len(H)):
    if max(H[:i]) <= H[i]:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

temp = 0
cnt = 0
for x in li:
    if x >= temp:
        temp = x
        cnt += 1
print(cnt)

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

print(ans)

Submission status: Accepted

Solution code:

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

max_height = 0
result = 0
for height in heights:
    if max_height <= height:
        result += 1
        max_height = height
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def get_num():
    return int(input())


def get_nums(n):
    res = [0 for _ in range(n)]
    for i in range(n):
        res[i] = int(input())
    return res


def get_numbers():
    return map(int, input().split())

n = get_num()
h = list(get_numbers())

highest = 0
ans = 0
for height in h:
    if height >= highest:
        highest = height
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

tmp = n[0]
sum1=1
for i in range(1,S):
  if tmp <= n[i]:
    tmp=n[i]
    sum1=sum1+1
print(sum1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def check(N, H):
    max_mount = 0
    count = 0
    mountList = H
    
    for i in mountList:
        if i >= max_mount:
            count += 1
            max_mount = i
    print(count)

N = int(input())
H = [int(i) for i in input().split()]
check(N, H)

Submission status: Accepted

Solution code:
def q39(n, h):
    count = 1
    for i in range(1, n):
        if h[i] >= max(h[:i]):
            count += 1
    return count


N = int(input())
H = [int(i) for i in input().split()]
print(q39(N, H))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def check():
    max_mount = 0
    count = 0
    N = int(input())
    mountList = list(map(int, input().split(" ")))
    
    for i in mountList:
        if i >= max_mount:
            count += 1
            max_mount = i
    print(count)
 
check()

Submission status: Accepted

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


count = 1
max = h[0]

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

print(count)

Submission status: Accepted

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

for i in range(1,n):
    if ma <= h[i]:
        ma=h[i]
        an+=1
    
print(an)

Submission status: Accepted

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

lft=x[0]

y=x[1:]

res=1

for i in range(n-1):
	if y[i]>=lft:
		lft=y[i]		
		res+=1

print(res)

Submission status: Accepted

Solution code:
# Great Ocean View

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

cnt = 1
top = H[0]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces1197
gi = lambda : list(map(int,input().strip().split()))
n, = gi()
l = gi()
ans = 0
m = -1
for e in l:
	if e >= m:
		m = e
		ans += 1
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
H_list = list(map(int,input().split()))[::-1]

cnt = 0
for i in range(N):
  temp_H_list = H_list[i:]
#  print(temp_H_list)
  if np.argmax(temp_H_list)==0:
    cnt+=1
    
print(cnt)

Submission status: Accepted

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

res = 0

for i in range(n):
    temp = 1
    for j in range(i):
        if mountains[j] > mountains[i]:
            temp -= 1
            break
    res += temp

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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