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())
s = list(map(int,input().split()))
ans = 1
max = s[0]
for i in range(1,n):
  if s[i] >= s[i-1] and max <= s[i]:
    ans+=1
    if s[i] >= max:
      max = s[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def chc(H,now):
    if(now == 0):
        return True
    else:
        for i in range(now):
            if(H[i]>H[now]):
                return False
        return True


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

counter = 0
for i in range(N):
    if(chc(H,i)):
        counter += 1

print(counter)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
num = int(input())
list = [int(i) for i in input().split()]
sum = 0
for j in range(num):
  list1 = list[:j+1]
  #print(list1)
  #print(max(list1))
  #print(list1[-1])
  if max(list1) == list1[-1]:
    sum += 1
  else:
    pass
print(sum)

Submission status: Accepted

Solution code:
from sys import stdin

readline = stdin.readline
_ = readline()

cnt = 0
m = 0
for h in map(int, readline().split()):
    if h >= m:
        m = h
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c=0
b=0
for i in h:
	if i >= b:
		c+=1
		b=i
print(c)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
ans=0
for i in range(n):
  count=0
  for j in range(i+1):
    if h[i]>=h[j]:
      count+=1
  if count==i+1:
    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:
#coding: utf-8

num = int(input())
columns = list(map(int, input().rstrip().split(' ')))
count = num
x = num
for h in columns:
    
    for i in columns[0:-x]:
        
        if h < i:
            count -= 1
            break
    x -= 1
print(count)

Submission status: Accepted

Solution code:
N, *H = map(int, open(0).read().split())
ma = [H[0]]
for hi in H[1:]:
    ma.append(max(hi, ma[-1]))
cnt = 1
for i in range(1, N):
    cnt += H[i] >= ma[i - 1]
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

N = _I()
H = LI()
ans = 1
for i in range(1, N):
    if all(H[j] <= H[i] for j in range(0,i)):
        if H[i-1] <= H[i]:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H=[int(x) for x in input().split()]
#for i in range(N):
#    nlist.append([int(x) for x in input().split()])
count=0
high=0
for i in H:
    if(high<=i):
        high=i
        count+=1
print(count)

Submission status: Accepted

Solution code:

def read_input():
    n = int(input())
    hs = list(map(int, input().split()))

    return n, hs


# indexまでの要素で最大を求め、index目が>=か調べる
def check_max(hs, index):
    check_hs = hs[:index + 1]
    max_hight = max(check_hs)
    return hs[index] >= max_hight

if __name__ == '__main__':
    n, hs = read_input()

    count = 0
    for i in range(n):
        if check_max(hs, i):
            count += 1

    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

for z in y:
    h.append(z)

v = 1
f = h[0]
for i in range(n):
    if i != 0:
        if f <= h[i]:
            if f < h[i]:
                v += 1
                f = h[i]
            else:
                v += 1

print(v)

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(i):
    if i != j:
      if H[j] <= H[i]:
        cnt += 1
  if cnt == i:
    ans += 1
print(ans)

Submission status: Accepted

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


def main():
    n = int(input())
    lh = list(map(int, input().split()))
    h_max = 0
    ret = 0
    for h in lh:
        if h >= h_max:
            ret += 1
        h_max = max(h_max, h)
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
count = 0
data = [int(s) for s in input().split()]
max = data[0]
for i in range(0,n-1):
    
    if max < data[i]:
      max = data[i]
    if data[i] <= data[i+1] and data[i+1] >= max:
        count += 1


print(count+1)

Submission status: Accepted

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



for i in range(len(H_list)):
    if i ==0:
        H_max = H_list[0]
        count = 1

    elif H_max <= H_list[i]:

        count += 1
        H_max = H_list[i]

print(count)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    hs = [int(x) for x in input().split()]
    count = 0
    for i in range(n):
        if i == 0:
            count += 1
        elif max(hs[:i]) <= hs[i]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

hight = 0
ans = 0

for i in H:
    if i >= hight:
        hight = i
        ans += 1

print(ans)

Submission status: Accepted

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

max = li[0]
ans = 1
for i in range(len(li)-1):
    if max <= li[i+1]:
        max = li[i+1]
        ans += 1
print(ans)

Submission status: Accepted

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

cnt = 1

for i, row1 in zip(range(len(list)), list[1:]):
    for row2 in list[:i+1]:
        if row2 > row1:
            break
    else:
        cnt += 1

print(cnt)

Submission status: Accepted

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

count = 1

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

print(count)

Submission status: Accepted

Solution code:
# coding:utf-8
n = int(input())
h = list(map(int, input().split()))
counter = 0

for i in range(n):
    #print(h[0:i+1])
    h_max = max(h[0:i+1])
    if (h[i] >= h_max) and (h[i] >= h[0]):
        #print(h[i])
        counter += 1
print(counter)

Submission status: Accepted

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

for (i,x) in enumerate(li):
    for k in range(i+1):
        if x < li[k]:
            break
    else:
        kotae += 1
print(kotae)

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

flag = False
sum = 1

for i in range(1, N):
    for j in range(0, i):
        if H[j] > H[i]:
            flag = False
            break
        flag = True
    if flag == True:
        sum = sum + 1
        flag = False

print(sum)

Submission status: Accepted

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


cnt = 0
for i, n in enumerate(H):
    if all([H[j] <= n for j in range(i)]):
      cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
hs = list(map(int, input().split()))
n = 1
for i, h in enumerate(hs, 1):
    if i == 1:
        continue
    is_exist = False
    for j in hs[:i-1]:
        if j > h:
            is_exist = True
            break
    if not is_exist:
        n += 1

print(n)

Submission status: Accepted

Solution code:
N = int(input())
inputlist = input().split()
H_list = []
for H in inputlist:
    H_list.append(int(H))
    
answer = 0
clearFrag = 0
for i in range(len(H_list)):
    if i == 0:
        answer += 1
    else:
        for prior in range(i):
            if H_list[prior] > H_list[i]:
                break
            else:
                clearFrag += 1
        if clearFrag == i:
            answer += 1
        clearFrag = 0

print(answer)

Submission status: Accepted

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

c = 0
for i, target in enumerate(ryokan_height_list):
  impediments = [impediment for impediment in ryokan_height_list[:i] if impediment > target]
  if len(impediments) == 0:
     c += 1

print(c)

Submission status: Accepted

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

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

    print(count)

main()

Submission status: Accepted

Solution code:
N = int(input().strip())
arrayH = list(map(int, input().strip().split(' ')))
ans = 1
for i in range(N - 1):
        yn = True
        for j in range(i+1):
                if arrayH[j] > arrayH[i+1]:
                        yn = False
        if yn:
                ans = ans + 1
print(ans)

Submission status: Accepted

Solution code:
count_mountain=int(input())
top=list(map(int,input().split()))
hardle=0
count=0
for x in top:
    if hardle<=x:
        count+=1
        hardle=x
print(count)

Submission status: Accepted

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

count = 0
max = H[0]

for h in H:
    if max <= h:
        max = h
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
H = list(input().split())
num = 0
for A in range(N):
  tf = 1
  if A == 0:
    num+= 1
    continue
  for B in range(A + 1):
    if int(H[A]) < int(H[B]):
      tf = 0
  if tf:
    num += 1
print("{}".format(num))

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
Hlist = [int(x) for x in input().split()]

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

print(count)

Submission status: Accepted

Solution code:
import numpy as np

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

can_see = 1  # 海の見える旅館の数  # 一番最初の旅館からは必ず見える
for i in range(1, n):
    if not np.any((h > h[i])[:i]):
        can_see+=1

print(can_see)

Submission status: Accepted

Solution code:
n = int(input())
see = 0
li = list(map(int, input().split()))
M = li[0]

for i in li:
    if M <= i:
        see += 1
        M = i

print(see)

Submission status: Accepted

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

sum=1
li=[lis[0]]

for i in range(1,N):
    if lis[i] >= max(li):
        sum=sum+1
    li.append(lis[i])

print(sum)

Submission status: Accepted

Solution code:
c = int(input())
H = input().split()

count = 1
for i in range(c-1):
  v = True
  for j in range(i+1):
    if int(H[i+1]) < int(H[j]):
      v = False
      break
  if v:
    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):
    a = 1
    for j in range(i):
        if h[j] > h[i]:
            a = 0
    ans += a
print(ans)

Submission status: Accepted

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

count = 0
height = 0
for i in range(N):
    if height <= Mountain[i]:
        height = Mountain[i]
        count += 1

print(count)

Submission status: Accepted

Solution code:
line = raw_input()
cases = int(line)

line = raw_input()
heights = list(map(int, line.split(' ')))

currentHeight = 0
cnt = 0
for H in heights:
    if currentHeight <= H:
        cnt += 1
    currentHeight = max(currentHeight, H)

print cnt

Submission status: Accepted

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

out=0
Max_H=0
for i in range(N):
  if Max_H <= A[i]:
    out+=1
    Max_H=A[i]
    
print(out)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
h=[0]*n
count=int(0)
hight=int(0)
s=[int(x)  for x in input().split()]
for i in range(n):
  if s[i]>=hight:
    hight=s[i]
    count +=1
print(int(count))

Submission status: Accepted

Solution code:
N = int(input().rstrip())

H = [ int(n) for n in input().rstrip().split() ]

C = 0

def Maxmam(H):
    if len(H) > 0:
        M = [i for i, x in enumerate(H) if x == max(H)]
        global C
        C += len(M)

        H = H[:min(M)]
        Maxmam(H)
    else:
        C

Maxmam(H)


print(C)

Submission status: Accepted

Solution code:
import sys

# 文字の読み込み
N = input()
N = int(N)

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

# 見える数
# 最初の山は必ず海が見えるので，1からスタート
view = 1

# 一番高い山の高さを記憶
MH = H[0]

# 一番高い山と高さを比較
for i in range(1,N):
    if H[i] >= MH:
        view += 1
        MH = H[i]

print(view)

Submission status: Accepted

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

cnt = 0
now = 0

for i in range(len(H)):
    if now <= H[i]:
        now = H[i]
        cnt += 1

print(cnt)

Submission status: Accepted

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

h1 = h[0]

n = 1

max = h1

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

print(n)

Submission status: Accepted

Solution code:
import math

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

view = 1
for i in range(N-1):
  if H[i+1]>=sorted(H[:i+1])[-1]:
    view = view+1
  else:
    continue
print(view)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
maxH = 0

for i in H:
    if maxH <= i:
        count += 1
    maxH = max(maxH,i)

print(count)

Submission status: Accepted

Solution code:
n = int(input())
mountains = list(map(int,input().split(' ')))
maxMount = mountains[0]
count = 0
for height in mountains:
    if maxMount <= height:
        count += 1
        maxMount = height
print(count)

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    B()

Submission status: 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+=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 i == 0:
    ans += 1
  else:
    h = H[:i+1]
    if max(h) == H[i]:
      ans += 1
 
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,H = [input() for i in range(2)]
N=int(N)
H=H.split(' ')
for i in range(N):
    H[i]=int(H[i])
cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#山の数
N = int(input())

#山の高さデータ
H = [int(i) for i in input().split()] 
result = 0

for index, i in enumerate(H):
    if index - 1 < 0:
        result += 1 
    else:
        flag = 0
        for kindex in range(index):
            if H[kindex] > i:
                flag = 1     
        if flag == 0:
            result += 1
            

print(result)

Submission status: Accepted

Solution code:
N = int(input())
H = input().split()
h = [int(k) for k in H]
l = []
ans = 1
for i in range(len(H)-1):
  l.append(h[i])
  
  if h[i+1] >= max(l):
    ans += 1
  
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
H_list=list(map(int, input().split()))
count=0
for i in range(len(H_list)):
  if i==0:
    min_H=H_list[i]
    count=count+1
    continue
  if H_list[i]>=min_H:
    count=count+1
    min_H=H_list[i]

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
h = list(map(int, input().split()))

ans=1

for i in range(1,len(h)):
  if len(list(filter(lambda x: x <= h[i], h[:i])))==i:
      ans=ans+1
print(ans)

Submission status: Accepted

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

def check(H):
  H_max = max(H_li)
  max_indexs = ([i for i, x in enumerate(H_li) if x == H_max])

  if len(max_indexs) > 1:
    max_index = max(max_indexs)
    return max_index
  else:
    return max_indexs[0]


max_index = check(H_li)

S = 0

for i in range(max_index):
  num = max_index - i
  try:
    if max(H_li[:num]) <= H_li[num]:
    	S += 1
  except:
    pass
    
print(S+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
b = list(map(int, input().split(' ')))
res = 0
hikaku_target = 0

for hei in b:
    if hei >= hikaku_target:
        res = res + 1
    hikaku_target = max(hikaku_target, hei)
print(res)

Submission status: Accepted

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

# abc124_b

# input
n = int(input())
Hs = [int(s) for s in input().split()]
# output
m = -1
count = 0
for h in Hs:
    if h>=m:
        m = h
        count += 1
ans = count
print(ans)

Submission status: Accepted

Solution code:
def main():
  N=int(input())  #数値入力
  H=list(map(int, input().split()))  #リスト入力
  
  max_height=H[0]
  count=0
  
  for i in range(N):
    if H[i]>=max_height:
      count=count+1
      max_height=H[i]

  print(count)
    
main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print (cnt)

Submission status: Accepted

Solution code:
N = input()
Hi = list(map(int, input().split()))
a = Hi[0]
b = 0
c = 0
for i in Hi:
    # print(i)
    if i >= c:
        b += 1
        c = i
print(b)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

count = 1
for i in range(1,N):
	#print(Hn[:i],Hn[i])
	if max(Hn[:i]) <= Hn[i]:
		count += 1

print(count)

Submission status: Accepted

Solution code:
#coding:utf-8

if __name__ == "__main__":
    N = int(input())
    tmp = input().split()
    Hs = []
    for t in tmp:
        Hs.append(int(t))
    total = 0

    for n in range(N):
        n_count = 0
        for i in range(0, n):
            if Hs[i] > Hs[n]:
                break
            n_count += 1
        if n_count == n:
            total += 1
        
    print(total)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

n = stdin.readline().rstrip().split()
h = [int(x) for x in stdin.readline().rstrip().split()]

sum = 0

for k in range(len(h)):
    if k == 0:
        sum += 1
        continue

    for l in range(k):
        if h[k] < h[l]:
            break
    else:
        sum += 1

print(sum)

Submission status: Accepted

Solution code:
N=int(input())
ta= list(map(int,input().split()))
ans=1
check=0
a=N-2
for i in range(N):
    if(i==0): continue
    for j in range(N-a):
        if(ta[j]<=ta[i]):
            if(j==N-a-1):
                ans+=1
        else:
            check+=1
        if(check==1):
            break
    check=0
    a-=1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 17:52:43 2019

@author: nakamuratakayuki
"""

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

Submission status: Accepted

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

count = 0

hs_len = len(Hs)
for i, H in enumerate(Hs):
    flag = True
    for j in range(i, -1, -1):
        if Hs[j] > H:
            flag = False
            break

    if flag:
        count += 1

print(count)

Submission status: Accepted

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

cnt = 0
for i in range(n):
    tmp = "ok"
    for j in range(i+1,n):
        if hlis[i]<hlis[j]:
            tmp = "ng"
    if tmp == "ok":
        cnt = cnt + 1
        
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 21:23:17 2019

@author: yuta
"""

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

def main(n,h):
    count = 1
    max_h = h[0]
    for i in range(1,n):
        if h[i] >= max_h:
            max_h = h[i]
            count += 1
    print(count)
main(N,H)

Submission status: Accepted

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

ans = 1
hmax = H[0]

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
Hmax = 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()))
max = 0

count = 0
for i in range(len(h)):
    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()))

res=0

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

    if h == Hmax:
        Hmax_idx = idx
        break

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

print(res)

Submission status: Accepted

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

flg = 0
cnt = 1

for i in range(1,len(h)):
    for j in range(0,i):
        if h[j]>h[i]:
            flg =1
    if flg == 0:
        cnt += 1
    else:
        flg = 0

print(cnt)

Submission status: Accepted

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

def ok(H, i):
    for j in range(0,i):
        #print(i, j, H[i], H[j])
        if H[i] < H[j]:
            #print("out")
            return 0
    return 1

    
cnt = 1
for i in range(1, N):
    cnt += ok(H, i)

print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    H = list(map(int, lines.pop(0).split(' ')))
    maxh = 0
    res = 0
    for r in H:
        if maxh <= r:
            res += 1
            maxh = r
    print(res)

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
H_list = [ i for i in map(int, input().split()) ]
ans = 1

for i in range(1, N):
    for j in range(N):
        if j >= i:
            break
        if H_list[i] < H_list[j]:
            break
        if j == i-1:
            ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def solve(N, mounts):
    count = 0
    for i in xrange(N):
        max_h = max(mounts[0:i+1])
        if mounts[i] >= max_h:
            count += 1
    return count

if __name__ == '__main__':

    N = sys.stdin.readline().strip()
    mounts = map(int, sys.stdin.readline().strip().split(" "))
    ans = solve(int(N), mounts)
    print ans

Submission status: Accepted

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

currentMax =H.pop(0)
total = 1

for i in H:
    if currentMax > i:
        continue
    currentMax = i
    total += 1

print total