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:
def main(input_list):
    count = 0
    for i_1, _ in enumerate(input_list):
        watch_sea = True
        for i_2 in range(i_1):
            if input_list[i_1] < input_list[i_2]:
                watch_sea = False
        if watch_sea:
            count += 1

    return count


if __name__ == "__main__":
    input()
    input_list = list(map(int, input().split()))
    print(main(input_list))

Submission status: Accepted

Solution code:
from sys import stdin

N = stdin.readline().rstrip()
H_list = stdin.readline().rstrip().split()
H_list_int = list(map(lambda x: int(x), H_list))  # strリストをintリストへ

ables = 1
max = H_list_int.pop(0)

for i in H_list_int:
    if max <= i:
        ables += 1
        max = i

print(ables)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
H = [int(_) for _ in input().split()]
ans = 0
beforeMax = -1
for hight in H:
    if hight >= beforeMax:
        ans += 1
        beforeMax = hight

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

mx = 0 
res = 0 
for n in H:
    if n >= mx: 
        res += 1
        mx = n 
print(res)

Submission status: Accepted

Solution code:
"""
B - Great Ocean View
https://atcoder.jp/contests/abc124/tasks/abc124_b
"""
if __name__ == '__main__':
    input_list = list(map(int, input().split()))
    N = input_list
    input_list = list(map(int, input().split()))
    H_list = input_list

    H1 = H_list[0]
    answer = 1
    for i, Hi in enumerate(H_list):
        if i == 0:
            continue
        else:
            west_H_list = H_list[0:i]
            max_h_west = sorted(west_H_list, reverse=True)[0]
            if max_h_west <= Hi:
                answer += 1

    print(answer)

Submission status: Accepted

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

count = 1
for k in range(1, N):
    if H_list_i[k - 1] <= H_list_i[k]:
        s = 0
        for l in range(k):
            if H_list_i[k] >= H_list_i[l]:
                s = s + 1
            else:
                break

        if s == k:
            count = count + 1
        s = 0
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*- 
input()
monts=map(int,input().split())
highest=0
count=0
for mont in monts:
    if mont>=highest:
        highest=mont
        count+=1
print(count)

Submission status: Accepted

Solution code:
n = (int,input())
li = list(map(int,input().split()))
max_height = 0
i = 0
count = 0
for i in li:
    if max_height <= i:
        count = count + 1
        max_height = i
    else:
        i = i+1
print(count)

Submission status: Accepted

Solution code:
N=int(input())
H=input()
ListA=[]
ListA=H.split()
for i in range(0,len(ListA),1):
  a=ListA.pop(i)
  b=int(a)
  ListA.insert(i,b)

c=0
for i in range(0,len(ListA),1):
  ListB=ListA[0:i+1]
  if ListA[i]>=max(ListB):
    c+=1

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

s = 1
for i in range(1, n):
    if all(map(lambda x: x <= hs[i], hs[:i])):
        s += 1

print(s)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, H):
    ans = 0
    hm = 0
    for h in H:
        if h >= hm:
            ans += 1
            hm = h
        
    return ans


def main():
    N = read_int()
    H = read_int_n()
    print(slv(N, H))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

COUNT = 0
for i in H:
	i = int(i)
	if i >= HIEST:
		HIEST = i
		COUNT = COUNT+1
print(COUNT)

Submission status: Accepted

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

cm = 0
count = 0
for item in h:
    if cm == 0:
        cm = item
        count += 1
    else:
        if cm > item:
            pass
        else:
            cm = item
            count += 1
print(count)

Submission status: Accepted

Solution code:
#ABC124 B
N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(N):
    if i==0:
        pass
    else:        
        i_bool = True
        for j in range(1,i+1):
            if H[j-1] > H[i]:
                i_bool = False
        if i_bool:
            ans+=1
print(ans)

Submission status: Accepted

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


def can_get_ocean_view(subheights):
    return 1 if max(subheights) == subheights[-1] else 0


def count_hotels_with_ocean_view(heights):
    hotels_with_ocean_view = [can_get_ocean_view(heights[:i]) for i in range(1, len(heights)+1)]
    return sum(hotels_with_ocean_view)


print(count_hotels_with_ocean_view(heights))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
m = a[0]
ans = 1
for i in range(1,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()))

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

N = int(input())
if (isinstance(N, int) != True) or (N < 1) or (N > 20):
    exit()
h = np.array([int(i) for i in input().split()])
if (np.any(h<1)==True) or (np.any(h>100)==True):
    exit()
c = 0
for j in range(len(h)):
    if j == 0:
        max = h[0]
        c += 1
        pass
    elif h[j] >= max:
        max = h[j]
        c += 1
print(c)

Submission status: Accepted

Solution code:
n = int(input())
h = tuple(map(int,input().split()))
count = 1
mosthigh = h[0]

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

print(count)

Submission status: Accepted

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


h1 = Hs.pop(0)
hmax = h1
hotel_cnt = 1

for i,h in enumerate(Hs):
    if hmax <= h:
        hotel_cnt += 1
        hmax = h

print(hotel_cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
A = list(map(int,input().split()))
B = np.array(A)
count = 0
for i in range(1,N):
    if max(B[:i])<=B[i]:
        count +=1
print(count+1)

Submission status: Accepted

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

count = 0

for i in range(n):
	over = False
	for j in range(i):
		if h[j] > h[i]:
			over = True

	if not over:
		count += 1

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

max = 0
count = 0
for i in h:
    if (i >= max):
        count = count + 1
        max = i
print(count)

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int,input().strip().split(" ")))
maxH = H[0]
look = 1
for i in range(N-1):
  if H[i+1] >= maxH:
    look = look + 1
    maxH = H[i+1]
print(look)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
H = np.array(list(map(int, input().split())))
tmp = []
for i in range(1, len(H)):
    tmp.append(all(H[:i]<=H[i]))
print(sum(tmp)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
trip = int(input())
sumiit = [int(i) for i in input().split()]
count = 1
for i in range(1, trip):
    jug = []
    for n in range(0, i):
        if sumiit[n] <= sumiit[i]:
            jug.append(True)
        else:
            jug.append(False)
    if all(jug):
        count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
h = list(map(int, input().split()))
count = 0
max = 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())
list=list(map(int,input().split()))
a=1
for j in range(n-1):
  if max(list[:j+1])<=list[j+1]:
    a=a+1
  else:
    pass
print(a)

Submission status: Accepted

Solution code:
N = int(input())
ListH = list(map(int,input().split()))
result = 0
for i in range(N):
    out = False
    for k in range(i):
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

Submission status: Accepted

Solution code:
def main():
	N = int(input())
	Hi = list(map(int, input().split()))
	current_max = 0
	ans = 0
	for h in Hi:
		if h >= current_max:
			ans += 1
			current_max = h
	print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def mountain(s):
    k = 1
    c = s[0]
    for i in range(len(s)-1):
        if s[i+1]>=c:
            c = s[i+1]
            k = k+1
    return k
a=input()
s=list(map(int, input().split()))
print(mountain(s))

Submission status: Accepted

Solution code:
line_len = int(input())
s = input().rstrip().split(' ')
inns = []
ans = 1
for i in range(line_len):
    inns.append(int(s[i]))
for i in range(1,line_len):
    for x in range(i):
        total = 1
        if inns[x] > inns[i]:
            total = 0
            break
    ans = ans + total
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,n):
	for j in range(i):
		if l[i] >= l[j]:
			if i -1 == j:
				ok += 1
			
		else:
			break

print(ok + 1)

Submission status: Accepted

Solution code:
it = int(input())
lists = list(map(int,input().split()))
x = 0
i = it 

for j in range(i):
  listo = lists[:j+1]
  if max(listo) == lists[j]:
    x += 1
  else:
    continue

print(x)

Submission status: Accepted

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

cnt = 0

for index, now in enumerate(inp):
	flag = 0
	for j in range(index):
		#注目の山より西の山の方が高い場合フラグを1にする
		if inp[j] > now:
			flag = 1
	#すべての西の山が低い場合カウントを増やす
	if flag == 0:
		cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
h_list=[int(i) for i in input().split()]
b = 1  # counter
c = 1  # answer
m = h_list[0]  # max height
while b != n:
    if h_list[b] >= m:
        m = h_list[b]
        c += 1
    b += 1
print(c)

Submission status: Accepted

Solution code:
g=1
y=0
a=int(input())
b=list(input().split())
h=int(b[0])
for i in range(1,a):
  if int(b[i-1])<=int(b[i]) and h<=int(b[i]) and y<=int(b[i]):
    y=int(b[i])
    g+=1
print(g)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
h = [int(i) for i in input().split()]
count = 1
tmp = h.copy()
for i in range(1, N):
    y = h[i]
    m = max(h[:i])
    if y >= m:
        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):
    flag = 0
    for j in range(i):
        if (H[j] <= H[i]):
            flag += 1
    if (flag == i):
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

import re

a = int(input())

b = input()
b = re.split(" ",b)

max = int(b[0])
ans = 0
for i in range(a):
    if(int(b[i]) >= max):
        max = int(b[i])
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, n):
    if h[i] >= max(h[:i]):
        ans_index.append(i)

print(len(ans_index))

Submission status: Accepted

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

import sys
import copy

input = sys.stdin.readline

# ---------------------------------------------------------

N = int(input())

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

ans = 0

for i in range(N):
    good = True
    for j in range(i):
        if H[j] > H[i]:
            good = False
    ans += good

print(ans)

Submission status: Accepted

Solution code:
# 整数の入力
N = int(input())
# 整数の入力
Mountain_list = map(int, input().split() )

Max_hight  = 0
Ocean_view = 0
## Ocean_flag = True

for i, Mountain in enumerate(Mountain_list):
	if i == 0:
		Ocean_view += 1
		Max_hight = Mountain
		continue

##	Ocean_flag = True

	if Max_hight <= Mountain:
		Max_hight = Mountain
		Ocean_view += 1

## 	for Comparison_mountain in Mountain_list[:i-1]:
## 		if Mountain < Comparison_mountain:
## 			Ocean_flag = False
## 			break:
	
##	if Ocean_flag:
##		Ocean_view += 1
##		Max_hight = Mountain

print(str(Ocean_view))

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
mountainList = list(map(int,input().split()))
sum = 0
max = 0

for mount in mountainList:
  if(mount >= max):
    sum += 1
  if(mount > max):
    max = mount
    
print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(N):
    for j in range(i):
      if H[i]>=H[j]:
        y+=1
    if y>=i:
        x+=1
    y=int(0)

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

score = 1

h1 = h_list[0]
max_h = h_list[0]
for i in range(1, n):
    h_i = h_list[i]
    if h_i >= h1 and h_i >= max_h:
        score += 1
        max_h = h_i
print(score)

Submission status: Accepted

Solution code:
N = int(input())

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

num_ryokan = 0
max_height = 0

for i in range(N):
  if max_height <= H[i]:#見えるとき
    num_ryokan +=1
    max_height = H[i]

print(num_ryokan)

Submission status: Accepted

Solution code:
h = int(input())
mount = [int(_) for _ in input().split()]
count = 0
for i in range(h):
  if i == 0:
    count += 1
  else:
    for j in range(i):
      if mount[i]<mount[j]:
        break
    else:
      count += 1
print (count)

Submission status: Accepted

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

for i in H_list:
    if max1 <= i:
        max1 = i
        count += 1

print(count)

Submission status: Accepted

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

max_h = 0
ans = 0

for h in H:
    if max_h <= h:
        ans += 1
        max_h = h
    
print(ans)

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
    max_h = max(max_h, h[i])
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
input = sys.stdin.readline

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

ans = 0

for i, h in enumerate(H):
    flag = True

    for x in range(i):
        if h < H[x]:
            flag = False
        
    if flag:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = int(input())
list1 = list(map(int,input().split()))
s = 0
for i in range(data-1):
  if list1[i+1] >= max(list1[:i+1]): 
    s = s + 1
  else:
    None
print(s+1)

Submission status: Accepted

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

cnt = 0

for i, v in enumerate(h):
    if v >= max(h[0:i+1]):
        cnt += 1


print(cnt)

Submission status: Accepted

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

i = 0
while i < len(H) - 1:
    if H[i] > H[i + 1]:
        del H[i + 1]
    else:
        i += 1
        if i >= len(H) - 1:
            break

print(len(H))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
maxIndex = [i for i, x in enumerate(a) if x == max(a)]
c = a[:maxIndex[-1]+1]
max = c[0]
r = len(c)
cnt = 0
for t in c:
  if max <  t:
    max = t
  if max > t:
    cnt += 1
print(r - cnt)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
max_H = 0

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())
i = 0
max = 0
cnt = 0
for x in input().split():
  x = int(x)
  if x >= max:
    cnt = cnt + 1
    max = x

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = input()
l = input().split()


result = 0

for i in range(len(l)):
    flg = 0

    if i == 0:
        result = 1
    else:
        for j in range(0, i):
            if int(l[i]) < int(l[j]):
                flg = 1

        if flg == 0:
            result = result + 1

if len(l) <= 20:
    print(result)

Submission status: Accepted

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

count = 1
for i, h in enumerate(H[1:], 1):
    if sum([1 for j in range(i) if h >= H[j]]) == i:
        count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

import sys
input = sys.stdin.readline

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	n=int(io())
	hs = list(map(int, io().split()))
	max_h=0
	nn=0
	for i, h in enumerate(hs):
		if h >= max_h:
			nn+=1
			max_h=h
	return nn

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Submission status: Accepted

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

s = [1 if max(H[:i]) <= H[i] else 0 for i in range(1, N)]
print(sum(s) + 1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# スペース区切りの整数の入力
high_list = [int(e) for e in input().split()]

ans=1

for i in range(1,N,1):
  
  look_flag=0
  #print("旅館の高さ:",high_list[i]) #旅館の高さ

  for j in range(0,i,1):
    #print(high_list[j]," ",end="") #左側のどれかの旅館の高さ
    if high_list[j] > high_list[i]:
      look_flag=1
      #print("NG")
      break
  
  if look_flag != 1:
    #print("OK")
    ans=ans+1
  
print(ans)

Submission status: Accepted

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

res = 0
for indexa, valuea in enumerate(a):
  for indexb, valueb in enumerate(a):
    if valuea < valueb and indexa != indexb:
      break
    if indexa == indexb:
      res += 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    cnt = 0
    for i in range(0, n):
        diff = [h_n[i] - h_n[j] for j in range(0, i)]
        cnt = cnt + 1 if len(list(filter(lambda x: x < 0, diff))) == 0 else cnt

    print(cnt)

    
main()

Submission status: Accepted

Solution code:
a = input().split()
N = list(map(int,input().split()))
A = int(a[0])

counter = 1

for i in range(2,A+1):
  N_new = N[0:i]
  N_new_len = len(N_new)
  if max(N_new) == N_new[int(N_new_len)-1]:
    counter += 1
print(counter)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

maxmount = 0
num = 0

for i in range(N):
    if maxmount<=int(Hx[i]):
        num = num+1
        maxmount = int(Hx[i])

print(num)

Submission status: Accepted

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

Submission status: Accepted

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

for x in all_list:
  if x >= acc_max:
    cnt += 1
    acc_max = x
    
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
h = [int(x) for x in 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()))
ans = 0
for i in range(n):
    flag = True
    for j in range(i):
        if h[j] > h[i]:
            flag = False
    if flag:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = input()
n=int(n)

h=[]
h.append(input().split())
ans =1
check_flag=0

for i in range(n):
	if i ==0:
		continue
	for  k in range(i):
		if int(h[0][i]) < int(h[0][k]):
			check_flag = 1
	if check_flag !=1:
		ans +=1
	check_flag=0
print(ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    h_list = [int(i) for i in input().split()]
    print(
        1 + len([i for i, h in enumerate(h_list[1:], start=1) if h >= max(h_list[:i])])
    )


if __name__ == "__main__":
    main()

Submission status: Accepted

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

r = 1
for i in range(1, n):
    for j in range(0, i):
        if lst[i] >= lst[j]:
            pass
        else:
            break
        if i == j + 1:
            r += 1

print(r)

Submission status: Accepted

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

h = l[0]
c = 0
for i in range(N):
  for j in range(i+1):
    if l[i] < l[j]:
      break
    if j == i:
      c += 1
print(c)

Submission status: Accepted

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

count = 0
counter = 0
for num in range(N):
    for num1 in range(num):
      if numbers[num] >= numbers[num1]:
        counter += 1
      else:
        continue
    if counter == num:
      count += 1
    counter = 0

print(count)

Submission status: Accepted

Solution code:
n = int(input())
hs = map(int, input().split())
l = -1
ret = 0
for h in hs:
    if h >= l:
        ret += 1
        l = h
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    count = 1

    for i in range(len(li)):
        #print(i)
        for j in range(i):
            if li[j] > li[i]:
                #print("li[j]:%d vs li[i]:%d", %(li[j], li[i]))
                break
            elif j == i-1:
            #    print(j)
                count += 1
            #else:
            #    print('j:%d vs i:%d' % (j, i))
            #    print('li[j]:%d vs li[i]:%d' % (li[j], li[i]))
            #    print("error")

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
num = int(input())
high_arr = list(map(int, input().split()))
result = 0
max = 0

for temp in high_arr:
    if temp >= max:
        result += 1
        max =temp
print(result)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
l=input().split(" ")
L=[]
for i in l:
    t=int(i)
    L.append(t)
ans=0
for i in range(n):
    k=0
    while(k<=i):
        if(L[i]<L[k]):
            break
        
        if(k==i):
            ans+=1
        k+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

for i in H:
  if i >= standard:
    standard = i
    counter += 1
    
print(counter)

Submission status: Accepted

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

ans = 0
for i in range(N):
	a=0
	for j in range(i+1):
		if H[j] <= H[i]:
			a=a+1
		else:
			break
	if a == i+1:
		ans=ans+1

print(ans)

Submission status: Accepted

Solution code:
_ = input()
hs = [int(i) for i in input().split(" ")]
res = 0
s = 0
for h in hs:
    if s <= h:
        s = h
        res += 1

print(res)