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())

m=list(input().split())
ans=1
max=[int(m[0])]
for i in range(1,n):
    if int(m[i])>=max[-1]:
        max.append(int(m[i]))
        ans+=1
print(ans)

Submission status: Accepted

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

    cnt = 0
    height = 0
    for h in H:
        if height <= h:
            cnt += 1
            height = h
    print(cnt)


main()

Submission status: Accepted

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

count = 1

for i in range(n):
  if i == 0:
    h = mountain[0]
    continue
  if mountain[i] < h:
    continue
  else:
    h = mountain[i]
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def B(lst,r=[],c=1):
    if len(lst) == c:
        return r
    if len([i for i in lst[0:c] if lst[c] >= i]) == c:
        return B(lst,r + [lst[c]],c+1)
    else:
        return B(lst,r,c+1)

i = int(input())
lst = list(map(int,input().split(" ")))
print(len(B(lst))+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

for i in range(1, len(a)):
    
    current = a[i]
    
    while i > 0:
        if current < a[i-1]:
            count += 1
            break
        i -= 1
        
print(n - 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]:
        count += 1
    max_ = max(max_, h[i])
print(count)

Submission status: Accepted

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

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


print(at)

Submission status: Accepted

Solution code:
n = int(input())
p = list(map(int, input().split()))
count = 1

for num in range(1,n):
    if max(p[:num]) <= p[num]:
        count += 1
print(count)

Submission status: Accepted

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

print([all([x <= h for x in H[:i]]) for i, h in enumerate(H)].count(True))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

previous=0
count=0

for i in H:
    if previous<=i:
        previous=i
        count+=1

print(count)

Submission status: Accepted

Solution code:
n = int(raw_input())
H = map(int, raw_input().split())
ans = 0
ph = -1
for h in H:
    if h >= ph:
        ans += 1
        ph = h
print ans

Submission status: Accepted

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

ans = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ret = 0
mh = 0
for h in H:
    if mh <= h:
        ret += 1
        mh = h

print(ret)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC124B
n = int(input())
h = list(map(int, input().split()))
max_height = 0
count = 0

for i in range(n):
    if h[i] >= max_height:
        max_height = h[i]
        count = count + 1
    else:
        pass
    
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def is_ocean_view(idx):
    return max(Hs[:idx]) <= Hs[idx]

ocean_views = [is_ocean_view(idx) for idx in range(1, N)]
print(ocean_views.count(True) + 1)

Submission status: Accepted

Solution code:
n = input()
high_list = list(map(int,input().split()))
most_highest = high_list[0]
can_count = 0

for i in high_list:
	if i>=most_highest:
		most_highest = i
		can_count +=1

print(can_count)

Submission status: Accepted

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

Submission status: Accepted

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

high, cnt = 0, 0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

H = []
N = int(stdin.readline().rstrip())
H = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    N = INT()
    H = LIST()
    maxv = 0
    count = 0
    for h in H:
        if maxv <= h:
            count += 1
            maxv = h
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    N = int(stdin.readline())
    H = list(map(int,stdin.readline().split()))
    answer = 1
    for i in range(1,len(H)):
        if H[i] >= max(H[:i]):
            answer += 1

    print(answer)

if __name__ == "__main__":
    main()

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:
N =int(input())
Hlist = list(map(int, input().split()))
maxH = 0
v = 0
for h in Hlist :
    if maxH <= h :
        v += 1
        maxH = h
print(v)

Submission status: Accepted

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

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

Submission status: Accepted

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

input()
h = list(map(int, input().split()))
count = 0
height_max = 0
for item in h:
    if height_max <= item:
        height_max = item
        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):
    if h[i]==max(h[:i+1]): ans +=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

maximum = 0
counter = 0

for h in H:
  # それまでの最大値であれば見られる
  if maximum <= h:
    maximum = h
    counter += 1
print(counter)

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

Submission status: Accepted

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

count = 1
cp_num = n[0]
for num in n[1:] :
    if (num >= cp_num) :
        count += 1
        cp_num = num

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

count = 1

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())
H = input().split()
H = [int(x) for x in H]
border = 0
answer = 0
for i in range(N):
  if H[i] >= border:
    border = H[i]
    answer = answer + 1

print(answer)

Submission status: Accepted

Solution code:
def abc():
    input()
    h = list(map(int, input().rstrip().split()))

    c = 0
    for i, x in enumerate(h):
        viewable = True
        for j in range(i+1):
            if h[j] > h[i]:
                viewable = False
        else:
            if viewable:
                c += 1
    print(c)


abc()

Submission status: Accepted

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

for i in range(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()))
c=1
for i in range(1,n):
    c += h[i]==max(h[:i+1])
print(c)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
H = np.array(input().split(),dtype=np.int32)

H_cummax = np.maximum.accumulate(H)
answer = (H_cummax == H).sum()

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(map(int, input().split()))
A = list(map(int, input().split()))
max = -1
count = 0
for height in A:
    if max <= height:
        count += 1
        max = height
print(count)

Submission status: Accepted

Solution code:
n=int(input())
arr=list(map(int, input().split()))
m=0
s=0
for x in arr:
  if m<=x:
    m=x
    s+=1
print(s)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

Solution code:
#-----------にゃんにゃん準備-----------#
def nyan(f=lambda x: x):
    return map(f,input().split())
def nyannyan(f=lambda x: x,i=0):
    if i==0: return list(map(f,input().split()))
    l = []
    for j in range(i):
        l.append(f(input()))
    return l
#------------にゃんにゃん------------#
n, = nyan(int)
h = nyannyan(int)
t, j = (0, 0)
for i in range(n):
    if(h[i]>=t):
        j+=1
        t=h[i]
print(j)
#---------にゃんにゃんおしまい---------#

Submission status: Accepted

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

res = 0
ma = h[0]
for e in h:
  if ma <= e:
    ma = e
    res += 1
print(res)

Submission status: Accepted

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

for i in H:
    if(i >= saidai):
        saidai = i
        cnt += 1
    

print(cnt)

Submission status: Accepted

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

for i in range(N):
        hoge = 0
        for k in range(i):
                if A[k] <= A[i]:
                        hoge += 1
                else:
                        break
        if hoge == i:
                output += 1

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(0, len(hlt)):
    hlt[i] = int(hlt[i])

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

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

highest = L[0]
ans = 0

for i in range(N):
        if L[i] >= highest:
                ans += 1
                highest = L[i]

print(ans)

Submission status: Accepted

Solution code:
n1 = int(input())
n2 = [int(i) for i in input().split()]

c1 = 0
for i1 in range(n1):
    if i1 == 0:
        c1 += 1
        continue
    if max(n2[0:i1]) <= n2[i1] :
        c1 += 1

print(c1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
b = a[0]
c = 0
ans = 0
for i in range(N-1):
  c += 1
  if b <= a[c] :
    b = a[c]
    ans += 1
print(ans + 1)

Submission status: Accepted

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

ans = 0
flag = True
for i in reversed(range(n)):
    flag = True
    for j in range(i):
        if h[i] < h[j]:
            flag = False

    if flag:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
H = list(map(int, input().split()))
count = 0
highest = 0
for height in H:
    if highest <= height:
        count += 1
        highest = height
print(count)

Submission status: Accepted

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


max = H[0]
ans = N
for i in xrange(1,N):
  if H[i-1]>H[i]:
    if max<H[i-1]:
      max = H[i-1]
    ans -= 1
    continue
  if max > H[i]:
    ans -= 1

print ans

Submission status: Accepted

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

cnt = 0
m = 0

for h in H:
    if h >= m:
        m = h
        cnt += 1

print(cnt)

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

Submission status: Accepted

Solution code:
n=int(input())
h=list(map(int,input().split()))
i=0
j=0
ans=0
while True:
  try:
     if h[i]>=j:
        ans=ans+1
        j=h[i]
     i=i+1
  except:
       print(ans)
       break

Submission status: Accepted

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

highest = h[0]
ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
h=[int(i) for i in input().split()]
print(sum(max(h[:i+1])<=h[i] for i in range(n)))

Submission status: Accepted

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

Hmax=L[0]
ans=0

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

print(ans)

Submission status: Accepted

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

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

print(cnt + 1)

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
# n=int(input())
# a,b=map(int, input().split())
# c=list(map(int, input().split()))
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# a=100
# b=0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋めのときの出力
# 000100-0.987654

import numpy as np
import math
import copy

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

num = 0

for i in range(len(h)):
    for j in range(len(h)):
        if i == j:
            num += 1
        if h[j] > h[i]:
            break

print(num)

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

Submission status: Accepted

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

import sys

input = sys.stdin.readline

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

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

main()

Submission status: Accepted

Solution code:
n=input()
a=map(int,raw_input().split())
count=1
b=0
for i in range(1,n):
    j=1
    while b >= 0 and i!=j-1:
        if a[i]>=a[i-j]:
            j+=1
        else:
            break
        if i==j-1 :
            count+=1
print(count)

Submission status: Accepted

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

print (ans)

Submission status: Accepted

Solution code:
number = int(input())
height = list(map(int,input().split()))
count = 1
height_max = height[0]

for i in range(1,number):
    if height[i] >= height_max:
        count += 1
        height_max = height[i]
print(count)

Submission status: Accepted

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

i = 0
ans = 1
Front = []

while i <= N-2:
    Front.append(H[i])
    if H[i+1] - max(Front) >= 0:
            ans = ans + 1
    i = i+1

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

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

count = 0
max_h = 0

for i in range(N):
	if H[i] >= max_h:
		max_h = 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(N):
    count = 0
    for j in range(i):
        if(H[i] >= H[j]):
            count += 1
    if(count == i):
        ans += 1

print(ans)

Submission status: Accepted

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

h.reverse()
ans = 0
flag = 0
for i in range(n):
    flag = 1
    for j in range(i, n):
        if h[i] < h[j]:
            flag = 0
            break

    if flag == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
def method3():
    n = (int(input()))
    nums = list(map(int, input().split()))
    result = 1
    hantei = True
    for i in range(1,n):
        hantei = True
        for j in range(i):
            if nums[i]<nums[j]:
                hantei = False
                break
        if hantei:
            result = result + 1
    print(result)
    
if __name__ == "__main__":
    method3()

Submission status: Accepted

Solution code:
import sys


def CheckRangeInt(input_str,_min,_max):

    if input_str.isdecimal()==0 or int(input_str)<_min or int(input_str)>_max:
        print("error")
        sys.exit()

    return int(input_str)


def CheckRangeList(input_list,_min,_max):
    for i in range(len(input_list)) :
        if H[i]<_min or H[i]>_max :
            print("error")
            sys.exit()
    return input_list

N=input()

# if N.isdecimal()==0 or int(N)<1 or int(N)>20:                                                                                                                                                             
#     print("error")                                                                                                                                                                                        
#     sys.exit()                                                                                                                                                                                            

# N=int(N)                                                                                                                                                                                                  
N=CheckRangeInt(N,1,20)


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

if len(H)!=N :
    print("error")
    sys.exit()

# for i in range(N) :                                                                                                                                                                                       
#     if H[i]<1 or H[i]>100 :                                                                                                                                                                               
#         print("error")                                                                                                                                                                                    
#         sys.exit()                                                                                                                                                                                        

H=CheckRangeList(H,1,100)

highest=0
can_see=0

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

print(can_see)

Submission status: Accepted

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

maxHeight = 0
ans = 0

for height in H :
    if height >= maxHeight :
        ans += 1
    maxHeight = max(maxHeight,height)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = input()
h = input().split()

sum_hotel = 0
max_height_mt = 0

for i in range(int(n)):
    if max_height_mt <= int(h[i]):
        sum_hotel += 1
    if max_height_mt <= int(h[i]):
        max_height_mt = int(h[i])

print(sum_hotel)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(x) for x in input().split()]
max_h = H[0]
answer = 1
for i in range(1, len(H)):
  if H[i]>=max_h:
    answer+=1
    max_h = H[i]
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:


def problem():
    N = int(input())
    H = list(map(int, input().split()))
    print(algorithm(N,H))


def algorithm(N: int, H):
  currentMax = H[0]
  counter = 1
  for i in range(1, N):
    if currentMax <= H[i]:
      counter += 1
      currentMax = H[i]
    
  return counter

problem()

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math


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


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

"""
ans = 0
for i in range(N):
    base = H[i]
    check = True
    for j in range(N):
        if i<=j:
            pass
        else:
            if H[i]>=H[j]:
                pass
            else:
                check = False
                break
    if check:
        ans += 1
print(ans)
"""