Problem:


Score : 200 points

Problem Statement

There are N mountains ranging from east to west, and an ocean to the west.

At the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.

The height of the i-th mountain from the west is H_i.

You can certainly see the ocean from the inn at the top of the westmost mountain.

For the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \leq H_i, H_2 \leq H_i, ..., and H_{i-1} \leq H_i.

From how many of these N inns can you see the ocean?

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq H_i \leq 100

Input

Input is given from Standard Input in the following format:

N
H_1 H_2 ... H_N

Output

Print the number of inns from which you can see the ocean.

Sample Input 1

4
6 5 6 8

Sample Output 1

3

You can see the ocean from the first, third and fourth inns from the west.

Sample Input 2

5
4 5 3 5 4

Sample Output 2

3

Sample Input 3

5
9 5 6 8 4

Sample Output 3

1



Sample input:
4
6 5 6 8


Sample output:
3

Submission status: Accepted

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

c = 0
for j in range(N):
    c+= 1 if all(H[i] <= H[j] for i in range(j)) else 0
print(c)

Submission status: Accepted

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

total = 1
flg = True
for i in range(1,N):
    for j in range(i):
        if H[j] > H[i]:
            flg = False
            break
    if flg:
        total += 1
    else:
        flg = True
        
print(total)

Submission status: Accepted

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

c=1

for i in range(1,N):
    s=0
    for j in range(i):
        if H[j]>H[i]:
            s=1
    if s==0:
        c+=1

print(c)

Submission status: Accepted

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

result = 0
height = 0
for h in H:
    if h >= height:
        result += 1
        height = h

print(result)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
h = list(map(int, input().split())) # 整数
max = 0
ans = 0

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

print(ans)

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

max_h = 0
total = 0
for h in H:
  if h >= max_h:
    total += 1
    max_h = h
  else:
    continue
    
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
list = list(map(int,input().split()))
cnt = 0
temp = 0
for i in list:
    if i >= temp:
        cnt += 1
        temp = i

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0
for i in range(1,n):
  flag=0
  for j in range(i):
    if h[i]>=h[j]:
      continue
    else:
      flag=1
      break
  if flag==0:
    cnt+=1
print(cnt+1)

Submission status: Accepted

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

ans = 0
curMax = 0
for h in H:
	if curMax <= h:
		ans += 1
	curMax = max(h,curMax)

print(ans)

Submission status: Accepted

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

ans = 1
for h in range(1,len(H),1):
  ryokan = H[h]
  max_mt = max(H[:h])
  if ryokan >= max_mt:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
arr=list(map(int, input().split()))
ma=arr[0]
res=1
for h in arr[1:]:
    if h >= ma:
        res+=1
        ma = h

print(res)

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

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

mi = H[0]

ans = 0

for i in H:
    if mi <= i:
        ans += 1
        mi = i


print(ans)

Submission status: Accepted

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

max = 0
sum = 0
for i in H:
    if max <= i:
        sum += 1
        max = i
print(sum)

Submission status: Accepted

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

result = 0
for i in range(n):
    if all([h[j] <= h[i] for j in range(i)]):
        result += 1

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
H = map(int, raw_input().split())
maxt = 0
count = 0
for i in H:
	if(maxt <= i):
		maxt = i
		count = count + 1
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

t = [0]
r = 0
for a in hl:
    if max(t) <= a:
        r += 1
    t.append(a)

print(r)

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
ans=0
for i in range(n):
    for k in range(i):
        if h[i]<h[k]:
            ans+=1
            break
Ans=n-ans
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[0:i]):
        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
            break
    if flag:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    ans = 0
    maxi = 0
    for i in range(N):
        if(A[i] >= maxi):
            ans += 1
        maxi = max(maxi, 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):
    if max(h[0:i]) <= h[i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

H = [int(x) for x in input().split()]
c = H[0]
ans = 1
for h in H[1::]:
    if c > h:
        continue
    else:
        c = h
        ans += 1

print(ans)

Submission status: Accepted

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

hotels = 1

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

print(hotels)

Submission status: Accepted

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

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

Submission status: Accepted

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

result = 1

for i in range(1, N):

    bigger = 0

    for j in range(0, i):
        if H[j] > H[i]:
            bigger += 1

    if bigger == 0:
        result += 1

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

counter = 0
num = 0

for i in H:
    if i >= num:
        counter += 1
        num = i

print(counter)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

def main():
    N = int(input())
    height = list(map(int, input().split()))

    count = 0
    for i, h in enumerate(height):
        if i == 0:
            count += 1
        elif max(height[:i]) <= h:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np
words = lambda t : list(map(t, input().split()))

n = int(input())
h = words(int)

total = 0
for i in range(n):
    v = True
    for j in range(0,i):
        if h[i] < h[j]:
            v = False
            break
    if v:
        total += 1
print(total )

Submission status: Accepted

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

Submission status: Accepted

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

result = 1
h_high = h[0]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
cnt = 1
max = l[0]


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

print(cnt)

Submission status: Accepted

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

x = 0
cnt = 0

for i in H:
    if i >= x:
        cnt += 1
        x = i

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
hh = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i):
        if hh[j] > hh[i]:
            break
    else:
        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,len(h)):
  flag = 0
  for j in range(i):
    if h[i] < h[j]:
      flag = 1
  if flag == 0:
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
ml=[0]
for i in l:
    res=ml[-1]
    if res<=i:
        ml.append(i)
    else:
        ml.append(res)
ans=0
for i in range(n):
    if ml[i+1]<=l[i]:
        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):
  c = 0
  for j in range(i):
    if h[i] >= h[j]:
      c += 1
  if c == i:
    ans += 1
print(ans)

Submission status: Accepted

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

cnt = 1

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

print(cnt)

Submission status: Accepted

Solution code:
# import numpy as np

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

ans = 0
max_H = 0
for i in range(N):
  if max_H <= Hs[i]:
    ans += 1
    max_H = max(max_H, Hs[i])

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
H=list(map(int,input().split()))
cnt=1
for i in range(1,n):
    res=0
    for j in range(i):
        if H[i]>=H[j]:
            res+=1
        if res==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):
    h = H[i]
    flag = True
    for j in range(i+1):
        if h < H[j]:
            flag = False
            break
    if flag == True:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
H = [int(_) for _ in stdin.readline().rstrip().split()]
count=0
for h in range(n):
    if h == 0:
        count+=1
    else:
        if H[h] >= max(H[:h]):
            count+=1
print(count)

Submission status: Accepted

Solution code:
def solve(N, H):
    cnt = 0
    for i in range(N):
        if i == 0:
            cnt += 1
            continue
        max_height = max(H[:i])
        if max_height <= H[i]:
            cnt += 1
    return cnt


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

print(solve(N, H))

Submission status: Accepted

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

ret = 0
highest = 0
for h in H:
    if h >= highest:
        highest = max(highest, h)
        ret += 1
print(ret)

Submission status: Accepted

Solution code:
n = int(input())

hight = list(map(int, input().split()))
ans = 0

kizyun = hight[0]

for i in range(n):
    if kizyun > hight[i]:
        pass
    else:
        ans += 1
        kizyun = hight[i]

print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

max_height = mountains[0]
ans = 0
for mountain in mountains:
    if mountain >= max_height:
        ans += 1
    max_height = max(max_height, mountain)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
h = input().split()
count = n
for i in range(n):
    h[i] = int(h[i])
    if i > 0:
        for j in range(i):
            if h[j] > h[i]:
                count -= 1
                break
print(count)

Submission status: Accepted

Solution code:
N=int(input())
H_list = [int(i) for i in input().split()]
max_height=0
result=0
for height in H_list:
  if height>=max_height:
    result+=1
    max_height = height
print(result)

Submission status: Accepted

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

state = Hs[0]
score = 0
for h in Hs:
    if state == h:
        score += 1
    elif state < h:
        state = h
        score += 1
    else:
        pass

print(score)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

ans = 0
max = 0
for i in h:
    if i >= max:
        max = i
        ans += 1

print(ans)

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

Submission status: Accepted

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
hi=0
for i in data:
    if i >= hi:
        ans+=1
        hi=i
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
N = ii()
nums = tuple(li())
cnt = 0
bar = -1
for n in nums:
    cnt += 1 if n >= bar else 0
    bar = max(bar, n)
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

max_h = 0
count = 0

for h in hs:
    if h >= max_h:
        count += 1
        max_h = h

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:

N= int(input())
a=[0]*N
ans=0
b=list(map(int,input().split()))

for i in range(N):
    if max(a)<=b[i] and 0<=b[i]:
        ans +=1
        a[i]=b[i]
    else:
        a[i]=b[i]
print(ans)

Submission status: Accepted

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

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

print(out)

Submission status: Accepted

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

count = 0
max_ = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
h_arr=[int(s) for s in input().split(" ")]

hmax=0
count = 0
for h in h_arr:
    if h >= hmax:
        count += 1
        hmax = h
print (count)

Submission status: Accepted

Solution code:
N = int(input())
hotel = list(map(int, input().split()))
count = 0
max_h = 0
for h in hotel:
    if max_h <= h:
        max_h = h
        count += 1

print(count)

Submission status: Accepted

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

m = 0
ans = 0
for i in h:
    if i >= m:
        ans += 1

    m = max(i, m)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

ans = 0
max_ = -1 
for h in H:
    if h >= max_:
        max_ = h
        ans+=1
print(ans)

Submission status: Accepted

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

highest = -1
n = 0
for i in h:
    if i >= highest:
        n += 1
        highest = i

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
max_height = H[0]

for n in range(1,N):
    if H[n] >= max_height:
        count += 1
        max_height = H[n]

print(count)

Submission status: Accepted

Solution code:
A = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

currentMax = A[0]

count = 0
for a in A:
	if a >= currentMax:
		count += 1
		currentMax = a
print(count)

Submission status: Accepted

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

for i in ryokan:
    if i >= max:
        count += 1
        max = i

print(count)

Submission status: Accepted

Solution code:
def int_raw():
    return int(input())


def ss_raw():
    return raw_input().split()


def ints_raw():
    return list(map(int, ss_raw()))


def ceil(num):
    if int(str(num)[-1]) == 0:
        return num
    return num + 10 - int(str(num)[-1])


ans = 0
max_height = 0
N = int_raw()
inputs = ints_raw()
for i in range(N):
    if max_height <= inputs[i]:
        ans += 1
    max_height = max(max_height, inputs[i])
print(ans)

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input().rstrip())
    H = list(int(_) for _ in input().split())
    ans = 0
    for i in range(N):
        if i == 0:
            ans+=1
        else:
            flag = True
            for j in range(i,-1,-1):
                if(H[i]<H[j]):
                    flag = False
                    break
            if flag:
                ans+= 1
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

max=0
count=0
for h in hs:
    if max <= h:
        count+=1
        max=h

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

m=0
num = 0
for h in H:
    if h>=m:
        num +=1
        m=h

print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

ok = 0
h_max = 0
for h_self in H:
    if h_max <= h_self:
        ok += 1
        h_max = h_self

print(ok)

Submission status: Accepted

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

sum = 1

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

Submission status: Accepted

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

tempmax = 0
count = 0

for i in range(N):
    if List[i] >= tempmax:
        count += 1
        if List[i] > tempmax:
            tempmax = List[i]
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())
H = [int(i) for i in input().split()]
firsth = 0 #current max height
ans = 0
for i in range(n):
    if H[i] >= firsth:
        ans += 1
        firsth = H[i]
print(ans)

Submission status: Accepted

Solution code:
import re
N = int(input())
H = [int(item) for item in re.split(r"\s", input())]

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

print(see)

Submission status: Accepted

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

count = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

max_height = h[0]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
max_H = H[0]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
number = int(input())

height = []

for i in list(input().split(" ")):
    height.append(int(i))

heightest = 0
view = 0

for i in height:
    if heightest  <= i:
        heightest = i
        view += 1
    else:
        pass

print(view)

Submission status: Accepted

Solution code:


def main(n, l):
    h = list(map(int, l.split(' ')))
    counter = 0
    max_h = 0
    for i in range(n):
        if max_h <= h[i]:
            counter += 1
            max_h = h[i]
    print(counter)
    
if __name__ == '__main__':
    try:
        n = int(input().strip())
        l = input().strip()
        main(n, l)
    except EOFError:
        pass

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

cnt = 0
pre = 0

for i in a:
    if pre > i:
        pass
    else:
        pre = i
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
input()
a=list(map(int,input().split(" ")))
M=0
r=0
for z in a:
  if M<=z:
    r+=1
    M=z

print(r)

Submission status: Accepted

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

cnt=0
h_max=0
for hi in h:
  if hi>=h_max:
    cnt+=1
    h_max=max(h_max, hi)
print(cnt)