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()))
max_height = 0
counter = 0
for i in range(N):
    if max_height <= H[i]:
        counter += 1
    max_height = max(max_height, H[i])
print(counter)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(x) for x in input().split()]
cnt = 0
mh = H[0]
for h in H:
  cnt += 1 if h >= mh else 0
  mh = max(h, mh)
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
a=list(map(int,input().split()))
ans=0
mdd=-(10**18)
for i in a:
  if i>=mdd:
    mdd=i
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

hmax = 0
count = 0
for h in H:
    if h >= hmax:
        hmax = h
        count += 1

print(count)

Submission status: Accepted

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

ans = 0
for i in range(N):
    flag = True
    for j in range(i):
        if Hs[j] > Hs[i]:
            flag = False
    if flag:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
L=[int(x) for x in input().split()]
mx=0
r=0
for i in range(N):
   if L[i]>=mx:
       r+=1
       mx=L[i]

print(r)

Submission status: Accepted

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

ans = 1
max_h = H[0]
for h in H[1:]:
  if h >= max_h:
    ans += 1
    max_h = h
print(ans)

Submission status: Accepted

Solution code:
#coding:utf-8
N=input()
H=map(int, raw_input().split())

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

Submission status: Accepted

Solution code:
# coding: utf-8
import numpy as np
from functools import lru_cache
import time

def main(): 
    if True:
        N = list(map(int, input().split()))
        H = list(map(int, input().split()))
    else:
        pass

    max = 0
    count = 0
    for h in H:
        if max <= h:
            count += 1
            max = h
    print(count)

if __name__ =='__main__':
    main()

Submission status: Accepted

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

ans = 0
m = 0
for h in hl:
    if m <=h:
        ans += 1
        m = h
    else:
        pass
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  N = readInts()[0]
  H = readInts()
  m = 0
  ans = 0
  for h in H:
    if h >= m:
      ans += 1
      m = h
  print(ans)

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
h=[int(x) for x in input().split()]
ans=0
maxhi_1=0
for hi in h:
    if maxhi_1<=hi:
        ans+=1
        maxhi_1=hi
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
max_height = 0
res = 0
for elem in input().split():
    h = int(elem)
    if max_height <= h:
        res += 1
        max_height = h
print(res)

Submission status: Accepted

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

ma = H[0]
count = 0
for hi in H:
    if hi >= ma:
        count += 1
        ma = hi
print(count)

Submission status: Accepted

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

Submission status: Accepted

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


def main():
  input()
  heights = map(int, input().split())
  thres = 0
  count = 0

  for h in heights:
    if h >= thres:
      count += 1
      thres = h

  print(count)


if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math


n = int(input())
hn = list(map(int, input().split()))
mx = 0
ans = 0
for h in hn:
  if mx <= h:
    ans += 1
    mx = h

print(ans)

Submission status: Accepted

Solution code:

N = int(input())
yama = input().split()

ans = 1
kj = int(yama[0])

for lop in range(1,N):
    if int(yama[lop]) >= kj :
        ans += 1
        kj = int(yama[lop])
    
 
print(ans)

Submission status: Accepted

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

n = 0
x = 0
for h in H:
    if x <= h:
        x = x + 1
        n = n + 1
        x = h
print(n)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(n) for n in input().split()]
    m = -1
    res = 0
    for a in A:
        if a >= m:
            m = a
            res += 1
    print(res)
if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(score)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = map(int,input().split())
tmp,res = 0,0
for i in H:
    if tmp <= i:
        res += 1
    tmp = max(tmp,i)
else:
    print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
map(int,input().split())

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

hls =  []

for i in h:
    hls.append(i)

mx = hls[0]
cnt = 1
for i in range(1,N):
    if mx <= hls[i]:
        cnt += 1
        mx = hls[i]

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1

for i in range(1,N) :
    if max(L[:i]) <= L[i] :
        ans += 1
        #print(i,"q")
print(ans)

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

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

mx = 0
count = 0
for i in a:
    if i >= mx:
        count += 1
        mx = max(i, mx)
print(count)

Submission status: Accepted

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

N = int(input())
X = list(map(int, input().rstrip().split(' ')))

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = N
for i in range(1,N):
    for j in range(i):
        if H[j] > H[i]:
            ans -= 1
            break
print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
before = H[0]
for i in range(1, N):
    if before <= H[i]:
        count += 1
    before = max(before, H[i])

print(count)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(x) for x in input().split()]
cnt = 0
for index,i in enumerate(H):
    flag = True
    for j in range(index):
        if(H[j]>i):
            flag = False
    if(flag):
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b = LI()
    if a < b:
        a, b = b, a
    ans = a
    a -= 1
    ans += max(a, b)
    print(ans)
    return

#B
def B():
    n = II()
    h = LI()
    dp = [0 for i in range(n)]
    ans = 0
    for i in range(n):
        dp[i] = max(dp[i - 1], h[i])
        if dp[i - 1] <= h[i]:
            ans += 1
    print(ans)
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

Solution code:
def main():
    input = sys.stdin.readline
    try:
        n = int(input())
        H = list(map(int, input().split()))
        
        cnt = 0
        now = 0
        for h in H:
            if h >= now:
                cnt += 1
            now = max(now,h)
            
        print(cnt)
        
    finally:
        input = None

import sys; sys.setrecursionlimit(50000)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

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

ans = 0

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
a=int(input())
li = list(map(int,input().split()))
ans = 0
th = 0
for i in range(a):
    if th <= li[i]:
        th = li[i]
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

h_max = h[0]

for i in h:
    if(h_max <= i):
        ans += 1
        h_max = i

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
highest=0
ans=0
for l in L:
    if l>= highest:
        ans+=1
        highest=l

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

m=l[0]
ans=0
for x in l:
    if m<=x:
        ans+=1
        m=x
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()))
m=0
ans=0
for h in H:
    if m<=h:
        m=h
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(len(hs)):
    if i == 0:
        ans +=1
    else:
        if hs[i] >= max(hs[:i]):
            ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

max_h = 0 
count = 0
for i, item in enumerate(h):
    if i == 0:
        max_h = item
        count += 1
    else:
        if item >= max_h:
            max_h = item
            count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = [int(s) for s 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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

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()
# print(H)
ans = []
for i in range(len(H)):
	if max(H[0:i+1]) == H[i]:
		ans.append(i)
print(len(ans))

Submission status: Accepted

Solution code:
_ = input()
nums = map(int, input().split())

c = 0
mx = 0

for i in nums:
    if i >= mx:
        c += 1
        mx = i

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

from itertools import chain
from functools import reduce
from collections import OrderedDict, Counter, deque
import operator

IS = lambda: int(input())
IA = lambda: [int(x) for x in input().split()]

_ = IS()
H = IA()

ans = 0
cur = -1
for h in H:
    if cur <= h:
        cur = h
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())

# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

input = sys.stdin.readline

# N個整数
# a, b, c = list(map(int, input().split()))

# 1整数
n = int(input())

# 空白区切りリスト整数
b = list(map(int, input().split()))

# 空白区切り文字列
# t, d = input().split()

ret = 0

for i in range(n):
    flag = True
    for j in range(i):
        if b[j] > b[i]:
            flag = False
    if flag == True:
        ret += 1
print(ret)

Submission status: Accepted

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

count = 0
for k, i in enumerate(lst):
    flg = True
    for j in lst[:k]:
        if j > i:
            flg = False
    if flg:
        count += 1
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

maxh = 0
ans = 0
for h in hlist:
  if h >= maxh:
    ans += 1
    maxh = h
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
lis = list(map(int,input().split()))
ans = 0
nu = 0
for num in lis:
  if num >= nu:
    nu = num
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
#

import itertools
from collections import Counter
import bisect

def main():
    N = int(input())
    H = list(map(int, input().split()))
    ans = 1
    prev = 0
    for i in range(1, N):
        can_see = True
        for j in range(0, i):
            if H[j] > H[i]:
                can_see = False
        if can_see:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

p=h[0]
ans=0

for i in h:
    if i>=p:
        ans+=1
        p=i

print(ans)

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))

    ans = 0
    H = A[0]
    for a in A:
        if a >= H:
            ans += 1

        H = max(H, a)

    return ans


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

Submission status: Accepted

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

ans = 0
maxi = -1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
H = IL()

tmp = H[0]
cnt = 1
for i in range(1,N):
    if tmp <= H[i]:
        cnt += 1
        tmp = H[i]
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

cnt = 1
mx = H[0]

for h in H[1:]:
    if h >= mx:
        cnt+=1
        mx = h

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

mx = -float("inf")

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

counter = 0
for i in range(n):
    flag = True
    for j in range(i):
        if h[j] > h[i]:
            flag = False
    if flag:
        counter += 1
print(counter)

Submission status: Accepted

Solution code:
import atexit
import io
import sys

buff = io.BytesIO()
sys.stdout = buff


@atexit.register
def write():
    sys.__stdout__.write(buff.getvalue())

n = input()
l = map(int, raw_input().split())
ans = 0
for i in xrange(n):
	valid = 1
	for j in xrange(i):
		if l[j] > l[i]:
			valid = 0
			break
	if valid:
		ans += 1
print ans

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

def kakaka():
    a = list(map(int, input().split()))
    b = map(int, input().split())
    c = int(input())

def start_process():
    return
def main():
    a = int(input())
    b = list(map(int, input().split()))
    count = 0
    min_data = -1
    for i in range(a):
        if b[i] >= min_data:
            min_data = b[i]
            count += 1
    print(count)




if __name__ == '__main__':
    main()

Submission status: Accepted

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

count = 0
max_h = 0
for h in H:
	if max_h <= h:
		count += 1
		max_h = h

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
N = int(input())
H = inpl()
max_ = 0
ans = 0
for h in H:
    ans += h >= max_
    max_ = max(h, max_)
print(ans)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N = read_a_int()
H = read_ints()

ans = 0
for i in range(N):
    tmp = H[i]
    ok = True

    for h in H[:i]:
        if tmp < h:
            ok = False

    if ok:
        ans += 1

print(ans)

Submission status: Accepted

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

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

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

print(cnt)

Submission status: Accepted

Solution code:
def great_ocean_view(N: int, H: list)->int:
    max_h = 0
    count = 0
    for h in H:
        if max_h <= h:
            count += 1
            max_h = h
    return count


if __name__ == "__main__":
    N = int(input())
    H = [int(s) for s in input().split()]
    ans = great_ocean_view(N, H)
    print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

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

        
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N=INT()
A=LIST()

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template #


N = ii()
H = lmi()
cnt = 0
for i in range(N):
    for j in range(i):
        if H[j] > H[i]:
            break
    else:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(n)

Submission status: Accepted

Solution code:
from sys import exit
N = int(input())
H = [int(n) for n in input().split()]
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
# exit()
tmp = H[0]
ans = 1
for i in range(1,len(H)):
    if(tmp <= H[i]):
        ans+=1
        tmp = H[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in h:
  if i >= ma:
    count += 1
    ma = i 

print(count)

Submission status: Accepted

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

cnt = 0
m = 0
for x in h:
    if m <= x:
        cnt+=1
        m=x

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
listH=list(map(int, input().split()))
index=0
count=0
max=0
while index < n:
    if listH[index] >= max:
        count+=1
        max = listH[index]
    index+=1
print(count)