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())
a = list(map(int,input().split()))
r = min(a)
count = 0
for i in range(n):
  if(r <= a[i]):
    count += 1
    r = a[i]
print(count)

Submission status: Accepted

Solution code:
import sys
import fractions
import math
import itertools

n=input()
h=list(map(int,input().split()))
H=[]
ans=0

for i in range(len(h)):
	H.append(h[i])
	if max(H)==h[i]:
		ans+=1

print(ans)

Submission status: Accepted

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

maxh = 0
cnt = 0

for a in H:
    if maxh <= a:
        cnt += 1
        maxh = max(maxh, a)
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

n, *H = map(int, sys.stdin.read().split())

def main():
    ma = 0
    cnt = 0
    for h in H:
        if h >= ma:
            cnt += 1
            ma = h
    return cnt

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

Submission status: Accepted

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

ans = 0
max_h = H[0]

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans+1)

Submission status: Accepted

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

print(counter)

Submission status: Accepted

Solution code:
n = int(input())
h = input().split()
max = 0
ans = []



for i in range(n):
	if max < int(h[i]) or max == int(h[i]):
		ans.append(int(h[i]))
		max = int(h[i])

print(len(ans))

Submission status: Accepted

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


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

Submission status: Accepted

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

count = 0
for i in range(n):
  count += 1
  for j in range(i):
    if hList[i] < hList[j]:
      count -= 1
      break
     
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
mx = 0
for i in H:
    if mx <= i:
        mx = i
        cnt += 1
print(cnt)

Submission status: Accepted

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

cnt = 0
for i in range(N):
    arr_H = [H[_] for _ in range(i+1)]
    if H[i] >= max(arr_H):
        cnt += 1
print(cnt)

Submission status: Accepted

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


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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = map(int, input().split())
ans = 0
max_height = 0

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

print(ans)

Submission status: Accepted

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

tof = [True]*n

for i, val in enumerate(h):
    if i==0:
        continue
    if not val==max(h[:i+1]):
        tof[i] = False

print(sum(tof))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, *H = map(int, read().split())

ans = 0
temp = H[0]
for h in H:
    if h >= temp:
        ans += 1
        temp = h

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    H = list(map(int, input().split(" ")))
    max = -1
    result = 0
    for h in H:
        if h >= max:
            result += 1
            max = h
    print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
N = int(input())
H = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
a = list(map(int, input().split()))
ret = 0
for i, h in enumerate(a):
    ret += max(a[:i + 1]) == h
print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math

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

max_array = [H[0]]
for i in range(1, len(H)):
    max_array.append(max(H[i], max_array[-1]))

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Hs = [int(s) for s in input().split(' ')]
count = 0
m = 0
for h in Hs:
    if m > h:
        continue
    m = h
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

hi = next(H)
cnt = 1
for h in H:
    if h >= hi:
        cnt += 1
        hi = h

print(cnt)

Submission status: Accepted

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

left = l[0]
count = 1
for i in range(1,n):
  if l[i] >= left:
    count += 1
    left = l[i]
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  if 'get_ipython' not in globals():  
    N = input()
    X = list(map(int,input().split()))
  else:
    N = 5
    X = list(map(int, "9 5 6 8 4".split()))
    print(X)

  max = 0
  count = 0
  for value in X:
    if value >= max:
      count = count + 1
      max = value
    else:
      continue
  print(count)
      
  
main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

ans = []
for i in range(N-1, 0, -1):
    ans.append(all(Hs[i] >= Hs[j] for j in range(i-1, -1, -1)))

print(sum(ans) + 1)

Submission status: Accepted

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

highest = mountains[0]

cnt = 0

for mt in mountains:
    if mt >= highest:
        cnt += 1
        highest = mt
        
print(cnt)

Submission status: Accepted

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

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

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]
    tmp = True
    
    for j in range(i-1, -1, -1):
      # print(i, j, h)
      tmp = tmp and h >= H[j]
    
    if tmp:
	    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
N, *H = map(int, open(0).read().split())
c = 0
for i in range(N):
    b = True
    for j in range(i):
        if H[j] > H[i]:
            b = False
    if b:
        c += 1
print(c)

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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

maxv = 0
result = 0
for v in a:
    if maxv <= v:
        result += 1
        maxv = v
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

hmax = 0
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
hills = list(map(int,input().split()))
t_max = hills[0]
ans = 1

for hill in hills[1:]:
    if hill >= t_max:
        ans += 1
        t_max = hill

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# Great Ocean View
import numpy as np

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

# solve
res = 1
for i in range(1, len(H)):
    if sum(H[:i] - H[i] > 0) == 0:
        res += 1

# output
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

count = 1

for i in range(1, n): #判定する旅館
    tmp = 0
    for j in range(i): #高さを判定
        if h[j] <= h[i]:
            tmp += 1
    if tmp == i:
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())

*H, = map(int, input().split())
count = 0
flg = 1
for i in range(len(H)):
    flg = 1
    for j in range(0,i,1):
        if H[i]>=H[j]:
            continue
        else:
            flg = 0
            break
    if flg==1:
        count = count + 1
    
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def main():
	# n,k = map(int,input().split())
	n = int(input())
	# s = str(input())
	a = list(map(int,input().split()))
	# l = [list(map(int, input().split())) for _ in range(n)]
	ans = 1
	for i in range(1,n):
		# print(max(a[:i]))
		if a[i] >= a[0] and a[i] >= a[i-1] and max(a[:i]) <= a[i]:
			ans += 1
	print(ans)



if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
from itertools import accumulate
from operator import eq
N = int(input())
H = list(map(int, input().split()))
print(sum(map(eq, H, accumulate(H, max))))

Submission status: Accepted

Solution code:
input()
lst=[int(i) for i in input().split()]
ans=0
_max=lst[0]
for i in lst:
  if i>=_max:
    ans+=1
    _max=i
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:
    m = h
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

c = 0
m = 0
for i in A:
    if i>=m:
        c += 1
        m = i
print(c)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
Hr = H[::-1]
cnt = 0


for i in range(N):
    flg = True
    for j in range(i+1, N):
        if Hr[i] < Hr[j]:
            flg = False
            break
    if flg == True:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,n):

    if h[i] >= max(h[:i]):
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
#--import&define---------------------
import math
import sys
input = sys.stdin.readline
def yes():
    print("Yes")
def no():
    print("No")

#--以下解答---------------------------------
n = int(input())
H = list(map(int, input().split()))
ans = 1
flag = True

for i in range(1,n):
    flag = True
    for j in range(0,i):
        if H[i] < H[j]:
            flag = False
            break
    if flag == True:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


N = int(sys.stdin.buffer.readline())
H = list(map(int, sys.stdin.buffer.readline().split()))

cummax = list(itertools.accumulate(H, max))
H = np.array(H, dtype=int)
cummax = np.array(cummax, dtype=int)
ans = np.count_nonzero(H >= cummax)
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:
    m = max(m,h)
    if h >= m:
        ans += 1

print(ans)

Submission status: Accepted

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

max_h = H[0]
for h in H:
    if h >= max_h:
        viewable.append(1)
    else:
        viewable.append(0)
    max_h = max(max_h, h)

ans = sum(viewable)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
#N=3
#H=[2, 5, 4]

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

Submission status: Accepted

Solution code:
def solve():
    N, *H = map(int, open(0).read().split())
    
    ans, h_max = 1, H[0]
    for i in range(1, N):
        if h_max <= H[i]:
            ans += 1
            h_max = max(h_max, H[i])
    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N, *L,  = [list(map(int, s.split())) for s in open(0)]
N = N[0]
L = L[0]
num_view = 1
for i in range(1, N):
    not_view = 0
    for j in range(0, i):
        if L[i] < L[j]:
            not_view += 1
            
    if not not_view:
        num_view += 1
print(num_view)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
N=int(input())
#N, L=input().split()
#S=input()
#T=input()
#S_list=list(S)
#T_list=  list(map(int, input().split(" ")))
#M=int(input())
#drink_list = [list(map(int, input().split(" ")))for i in range(M)]
#print(T_list[1])
#N=int(N)
#C=int(C)
#K=int(K)
T_dummy_list=[]
sentence_list=[]
total=0
mojiretu=""
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#for i in range(K):
# ID_list.append(i+1)
#print(ID_list)
#for i in range(H)
#この下の行が二次元リストの読み込
#intを消して記号を読み込めるようにしたしかしこれでは文字列から読み込んでいるのと同じ
#sentence_list =  [list(input())for i in range(N)]#一文字づつばらして入れてしまう
#s = [input() for i in range(N)]
#複数行に複数の入力値を取得し、出力する
#sentence_list =  (list(input())for i in range(N))
#for i in range(H):
#  ppixel_list=list(input())
#  
#print(pixel_list)
i=0
j=0
#high_pixel_list =[['' for i in range(W)]for j in range(2*H)]
#print(high_pixel_list)
#print(pixel_list[0][1])#行　列の順番にかっこが並んでいる

#整数二次元配列を読み込む時のやり方
#gate_list =  [list(map(int, input().split(" ")))for i in range(M)]
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#print(s)
#sentence_list=sorted(s)
#print(sentence_list)
#スペースでいれつつ値を取得
can_see=0
hight_list =  list(map(int, input().split(" ")))
for i in range(len(hight_list)):
     
     for j in range(i+1):
      if hight_list[i] >= hight_list[j]:
         pass
         if j==i:
          can_see +=1
      else:
          break

print(can_see)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, h = int(input()), [0] + list(map(int, input().split()))
print(len([i for i, x in enumerate(h[2:], start=2) if max(h[:i]) <= h[i]]) + 1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, h = int(input()), list(map(int, input().split()))
print(len([i for i, x in enumerate(h) if (i == 0) or ((i == 1) and (h[0] <= h[i])) or ((i > 1) and (max(h[:i]) <= h[i]))]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
h = list(map(int, input().split()))
print(len([i for i, x in enumerate(h) if (i == 0) or ((i == 1) and (h[0] <= h[i])) or ((i > 1) and (max(h[:i]) <= h[i]))]))

Submission status: Accepted

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

ans = 0
for i in range(n):
  ans += 1 if (i == 0) or ((i == 1) and (h[0] <= h[i])) or ((i > 1) and (max(h[:i]) <= h[i])) else 0

print(ans)

Submission status: Accepted

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

ans = 0
for i in range(n):
  if i == 0:
    ans += 1
  elif (i == 1) and (h[0] <= h[i]):
    ans += 1
  elif (i > 1) and (max(h[:i]) <= h[i]):
    ans += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

h_max = 0
m = 0

for h in hs:
  if h >= h_max:
    h_max = h
    m += 1

print(m)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
m=0
for i in range(n):
    f=True
    for j in range(i):
        if h[j]>h[i]:
            f=False
            break

    if f:
        m+=1
print(m)

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

total=1

for i in range(1,n):
  flag=True
  #print(i)
  for j in range(i):
    #print(j)
    dif=hl[i]-hl[j]
    #print(dif)
    if dif<0:
      flag=False
      break
  if flag:
    total+=1
print(total)

Submission status: Accepted

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

    
p_b()

Submission status: Accepted

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

maxx = -1
cnt = 0
for i in range(len(l)):
    if l[i] >= maxx:
        maxx = l[i]
        cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import heapq
import sys
from collections import Counter
import numpy as np
import datetime

#N,K=map(int, input[0].split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

N=int(input())
H=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

cnt=1
high=H[0]
for i in range(1,len(H)):
    if H[i]>=high:
        high=H[i]
        cnt+=1
    
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:
re = 1
N = int(input())
H = list(map(int, input().split()))
tmp = H[0]

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

Submission status: Accepted

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

cnt = 1
hmax = h[0]

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

print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    return


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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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