Problem:


Score : 200 points

Problem Statement

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

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

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

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

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

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

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq H_i \leq 100

Input

Input is given from Standard Input in the following format:

N
H_1 H_2 ... H_N

Output

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

Sample Input 1

4
6 5 6 8

Sample Output 1

3

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

Sample Input 2

5
4 5 3 5 4

Sample Output 2

3

Sample Input 3

5
9 5 6 8 4

Sample Output 3

1



Sample input:
4
6 5 6 8


Sample output:
3

Submission status: Accepted

Solution code:
n=int(input())
a=input().split()
for j in range(n):
    a[j]=int(a[j])
m=[]
m.append(a[0])
for k in range(n-1):
    x=max(m)
    if x<=a[k+1]:
        m.append(a[k+1])
print(len(m))

Submission status: Accepted

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

Submission status: Accepted

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

v = 0


for i in range(len(l)-1,-1,-1):
    j = 0
    nosee = False 
    for j in range(i):
        if(l[i]<l[j]):
            nosee = True
            break
    if(not(nosee)):
        v+=1
print(v)

Submission status: Accepted

Solution code:
def checkm(n,mount):
    max = 0
    ans = 0
    for i in mount:
        if max <= i:
            max = i
            ans += 1
    return ans

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

print(checkm(n,mount))

Submission status: Accepted

Solution code:
n = int(input())
h = input().split()
H = []
i = 0
while(i < n):
    H.append(int(h[i]))
    i+=1
#print(H)

i = 0
high = 0
num = 0
while(i < n):
    if(H[i] >= high):
        num += 1
    if(high < H[i]):
        high = H[i]
    i += 1

print(num)

Submission status: Accepted

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

count = 1

for i in range(n):
    if(i == 0):
        continue
    if(max(l[:i+1]) == l[i]):
        count += 1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
h = list(int(i) for i in input().split())
h.insert(0, 0)
count = 0

# print(h)

for i in range(n+2):
    if 1 < i:
        tmp_list = h[0:i]
        my_hotel = h[i-1]
        if max(tmp_list) <= my_hotel:
            count += 1
#        print(i, tmp_list, my_hotel, count)

print(count)

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

Solution code:
N = int(input())
Hs = input().split(" ")

H = 0
res = 0

for i in range(N):
  if int(H) <= int(Hs[i]):
    res += 1
    H = Hs[i]

print(res)

Submission status: Accepted

Solution code:
# coding:utf-8
n = int(input())
h= list(map(int, input().split()))
max = h[0]
count = 1

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

print(count)

Submission status: Accepted

Solution code:
N=int(input())
H=list(map(int,input().split()))
H.append(0)
max1=H[0]

X=1
for i in range(N):
    if max1 <= H[i+1]:
        X+=1
        max1=H[i+1]
        
print(X)

Submission status: Accepted

Solution code:
from sys import stdin

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

if N == 1:
    print(1)
    exit()

cnt = 1
if H_list[1] >= H_list[0]:
    cnt += 1

for i in range(2, N):
    if H_list[i] >= max(H_list[:i]):
        cnt += 1

print(cnt)

Submission status: Accepted

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

count = 0
highest = h[0]

for i in h:
  if highest <= i:
    highest = i
    count += 1

print(count)

Submission status: Accepted

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

def main():
    n = int(input())
    height_mountains = [ int(_)  for _ in input().split() ]

    height_highest = 0
    count_see_sun = 0

    for mountain in height_mountains:
        if mountain >= height_highest:
            height_highest = mountain
            count_see_sun += 1

    print(count_see_sun)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Hs = list(map(int, input().split()))
print(len([i for i in range(0, len(Hs)) if all([Hs[j] <= Hs[i] for j in range(0, i)])]))

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())
H = []
h = input().split()

for i in range(N):
    h_n = int(h[i])
    H.append(h_n)

ans = 1
for j in range(1,N):
    if all([H[j] >= H[k] for k in range(0,j)]):
        ans += 1

print(ans)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())
s = input().split()  # n個横並びに入力されるとき

for i in range(n):
    s[i] = int(s[i])

count = 1
biggest = s[0]

for i in range(n-1):
    if(biggest <= s[i+1]):
        count += 1
        biggest = s[i+1]

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

count = 1
for index, height in enumerate(H):
    tmp_count = 0
    if index == 0:
        continue
    for i in range(0,index):
        if H[i] > H[index]:
            continue
        tmp_count += 1
    if tmp_count == index:
        count += 1

print(count)

Submission status: Accepted

Solution code:
hpi = input()
count = 1
k = list(map(int, input().split(" ")))
for c in range(int(hpi) - 1):
  jo = "yes"
  n = k[:c + 2]
  for co in range(len(n) - 1):
    if n[co] > k[c + 1]:
      jo = "no"
    else:
      pass
  if jo == "yes":
    count += 1
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# input
n = int(input())
list = [int(a) for a in input().split()]

counter = 1
for ii in range(1, n):
    flag = 0
    for jj in range(0, ii):
        if list[ii] < list[jj]:
            flag = 1
            break
    if flag == 0:
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
num=int(input())
Hn=input().split()
HMax=0
count=0

for i in range(num):

    if int(Hn[0]) <= int(Hn[i]):
        if HMax   <= int(Hn[i]):
            count += 1
            HMax=int(Hn[i])

print(count)

Submission status: Accepted

Solution code:
mt_count=int(input())
heights = list(map(int, input().split()))
count = 0

i=1

for i in range(mt_count):
  check_flag = 1
  for j in range(i):
    if heights[j] > heights[i]:
      check_flag = 0
  if check_flag == 1:
    count += 1

print(count)

Submission status: Accepted

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

count = 0
highest = 0
for H in Hs:
    if H >= highest:
        count += 1
    highest = max(highest, H)

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

ans = 1
flg = False
for i in range(n):
    for j in range(i):
        if l[i] >= l[j]:
            flg = True
            continue
        else:
            flg = False
            break
    if flg == True: ans += 1  

print(ans)

Submission status: Accepted

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

count = 1
max_height = H[0]

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

c=0


for i in range(0,len(a)):
    flag=True
    for j in range(0,i):
        #rint(a[j],a[i])
        if a[j]>a[i]:
            flag=False
    if flag:
        c+=1
print(c)

Submission status: Accepted

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

count = 1
for i in range(len(H)-1):
  count += 1 if max(H[:i+1])<=H[i+1] else 0
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cont)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
hs = input()
h = [int(j) for j in hs.split(" ")]
count = 0
flg = 0
for i in range(n):
    for j in range(0, i):
        if h[i] < h[j]:
            flg = 1
            break
    if flg == 0:
        count = count + 1
    flg = 0

print(count)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
input_H = input().split()
H = np.empty(N, int)
for i in range(N):
    H[i] = int(input_H[i])

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

Submission status: Accepted

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

for i in range(1, n):
    if h[i] >= m:
        c += 1
        m = h[i]
print(c)

Submission status: Accepted

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

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    n = int(lines[0])

    h = [int(e) for e in lines[1].split(" ")]

    return (n, h)


def solve(n, h):

    if debug:
        log("n=%s" % n)
        log("h=%s" % h)
    
    result = 1
    for i in range(1, n):
        count = 0
        for j in range(i):
            if h[j] <= h[i]:
                count = count + 1
            else:
                break
        if count == i:
            result = result + 1
        

    return result


def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Accepted

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

    counter = 0
    for i, h in enumerate(H):
        canView = True
        for j in range(i):
            if H[j] > h:
                canView = False
        if canView:
            counter += 1

    print(counter)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

base = hlist[0]
result = 0

for h in hlist:
  if base <= h:
    result = result +1
    base = h

print(result)

Submission status: Accepted

Solution code:
def main():

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

    count = 1

    for n in range(1, N):
        flag = True
        for m in range(n):
            if H[m] > H[n]:
                flag = False
        if flag:
            count += 1

    print(count)


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

max = -1
ans = 0

for i in a:
  if i >= max:
    max = i
    ans = ans + 1
  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


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

ans = 0

for i in range(len(e)):
    if i==0:
        ans += 1
        continue

    flg = True
    for i2 in range(i+1):
        if e[i2]>e[i]:
            flg = False

    if flg:
        ans += 1

print(ans)

Submission status: Accepted

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

N = int(input())

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

num = 1
if N > 2:
    for i in range(1,N):
        cansee = True
        for j in range(i):
            if H[i] < H[j]:
                cansee = False
                break
        if cansee:
            num += 1

print(num)

Submission status: Accepted

Solution code:
n = int(input())
h = list(map(int, input().split()))
def gov(n, h):
    ans = 1
    for i in range(1, n):
        cnt = 0
        for j in range(i):
            if h[j] == max(h[i], h[j]) and h[i] != h[j]:
                break
            cnt += 1
        if cnt == i:
            ans += 1
    return ans
print(gov(n, h))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = raw_input()                                    

ar = []                                            
h = raw_input().split()                            

cnt = 0                                            
m = 0
for i in h:
    i = int(i)                                     
    if (i >= max(m, i)):
        cnt += 1                                   
        m = i

print cnt

Submission status: Accepted

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

SUM = 1
for i in range(1,len(H)):
  if sum([h > H[i] for h in H[:i]]) == 0 :
    SUM += 1
print(SUM)

Submission status: Accepted

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

maxH = 0
count = 0

for h in hight:
    if(maxH <= h):
        count += 1
        maxH = h

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力
mountains = list(map(int, input().split()))

height = mountains[0]
sum = 1
for i in range(1,a):
    if mountains[i] >= height:
        sum += 1
        height = mountains[i]

# 出力
print(sum)

Submission status: Accepted

Solution code:
l = int(input())
c = 1
b4most = 0
answer = 0
ryokan = list(map(int, input().split()))
for data in ryokan:
    if b4most <= data:
        answer += 1
        b4most = data
print(answer)

Submission status: Accepted

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

tmp = 0
ans = 0

for h in H:

    if h >= tmp:
        tmp = h
        ans += 1

print(ans)

Submission status: Accepted

Solution code:

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

n = 0
Hmax = 0

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

print(n)

Submission status: Accepted

Solution code:
H =  input()
a = list(map(int,input().split()))
counter =0
for i, n in enumerate(a):
  if i ==0:
    counter +=1
  elif i!=0 and max(a[:i])<=n:
    counter +=1
print (counter)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
hotels = [int(hotel) for hotel in input().split()]

highest = hotels[0]
hasOceanView = 0
for hotel in hotels:
  if hotel >= highest:
    hasOceanView += 1
    highest = hotel

print(hasOceanView)

Submission status: Accepted

Solution code:
ryokan = int(input())
height = input().split()

counter = 1
tmp = int(height[0])

for i in range(1, ryokan):
    if int(height[i]) > tmp:
        tmp = int(height[i])
    if int(height[i]) >= tmp:
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
num = int(input())
height = list(map(int,input().split()))
SUM = 1
comp = height[0]

for i in range(1,num):
  if comp <= height[i]:
    comp = height[i]
    SUM += 1

print(SUM)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 09:52:55 2019

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy
import bisect

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

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

def main():
    cnt = 0
    tmp_max =0
    for n in range(N):
        if tmp_max <=H[n]:
            tmp_max = H[n]
            cnt+=1
    print(cnt)
 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

c = 0

if len(h)==1:
    print(1)
else:
    m = h[0]
    for i in h:
        if i>=m:
            c += 1
            m = i

    print(c)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
H = list(map(int,input().split()))
maxnum = 0
count = 0
for Hi in H:
    if Hi >= maxnum:
        count += 1
        maxnum = Hi

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
countH = 0
N = int(input())
H_lists = map(int,input().split(" "))
max_tmp=0
for Hi in H_lists:
    if Hi>=max_tmp:
        countH+=1
        max_tmp=Hi        
print(countH)

Submission status: Accepted

Solution code:
N = int(input())

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

count = 1

for n in range(1 , N):
	for j in range(n):
		B = True
		if H[j] > H[n]:
			B = False
			break
	if B == True:
		count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

counter = 1
for i in range(1, N):
    flag = 1
    for j in range(i):
        if h[i] - h[j] < 0:
            flag = 0
    if flag == 1:
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
N=int(input())
H = [int(i) for i in input().split()]
ans = 0
check = [0 for _ in range(N)]

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

print(ans)

Submission status: Accepted

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

count = 1 #西の旅館からは見えるため
No = True
for i, hi in enumerate(H):
    if i == 0:
        continue
    No = True
    for j in range(0, i):
        if H[j] > hi:
            No = False
            break
    if No:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
li = list(map(int,input().split()))
i=0
c=0
a=1
for n in li:
  while c<i:
    if li[c]>n:
      break
    c+=1
    if c==i:
      a+=1
  c=0  
  i+=1
print(a)

Submission status: Accepted

Solution code:

Num = int(input())
Hights = input().split()
hotels = 0

curHight = 0

for i in range(Num):
    if curHight <= int(Hights[i]):
        hotels+=1
        curHight = int(Hights[i])
        
print(hotels)

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0

for i,h in enumerate(hotel):
#    print i, h
    flg = 1
    for j in range(i+1):
#        print "--", h, hotel[j]
        if h < hotel[j]:
            flg = 0
            break

    if flg == 1:
        cnt += 1

print cnt

Submission status: Accepted

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

c = 0

for i in range(N):
    d = 0

    for j in range(i):
        #print(H[i], H[j])
        if H[i] > H[j] or H[i] == H[j]:
            d += 1
    if d == i:
        c += 1
print(c)

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:
num = int(input())
height_raw = input().split()
height = []
for a in range(num):
  height.append(int(height_raw[a])) 

counter = 0
max_height = 0

for b in range(num):
  if height[b]>=max_height:
    max_height = height[b]
    counter += 1

print(counter)

Submission status: Accepted

Solution code:
n = int(input())

h = list(map(int,input().split(sep=" ")))

ans=0

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(counter)

Submission status: Accepted

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

ans = 0

for i in range(len(h)):
    flag = True
    for j in range(len(h) - i):
        if h[len(h)-i-1] < h[j]:
            flag = False
            break
    if flag:
        ans += 1

print(ans)

Submission status: Accepted

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

counter = 0
for i in range(N):
    if i == 0:
        counter += 1
    if i > 0:
        max_before_i = max(H_list[:i+1])
        if max_before_i <= H_list[i]:
            counter += 1

print(counter)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!


N = int(input())

input_list = input().split()

base = 0
count = 0

for i in input_list:
    num = int(i)

    if base <= num:
        count += 1
        base = num

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

maxh = h[0]
count = 1

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

print(count)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

n = ni()
h = na()

c = 1
maxh = h[0]
for i in range(n-1):
    if maxh <= h[i+1]:
        c += 1
        maxh = h[i+1]

print(c)

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
flag = 0
for i in range(n):
  l_h = l[:i+1]
  if l_h[i] == max(l_h):
    flag +=1
print(flag)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

max = h[0]
cnt = 1

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

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
mountain_list = list(map(int, input().split()))
highest = 0
count = 0
for x in mountain_list:
    if x >= highest:
        count += 1
        highest = x

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
test = list(map(int,input().split()))
counter = 0
    
for i in range(len(test)):
    test2 = test[:i+1]
    if max(test2) == test2[-1]:
        counter += 1
        
print(counter)

Submission status: Accepted

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

highest = 0
can_sea_hotels = 0

for i in range(len(H)):
    if highest <= H[i]:
        highest = H[i]
        can_sea_hotels += 1
    
print(can_sea_hotels)

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

Submission status: Accepted

Solution code:
N = int(input())
yamas = [int(j) for j in input().split()]
highest = 0
mountains = 0

for i in range(N):
    if yamas[0] >= highest:
        mountains += 1
        highest = yamas[0]
        yamas = yamas[1:]
    else:
        yamas = yamas[1:]

print(mountains)

Submission status: Accepted

Solution code:
N = input();
l = map(int, raw_input().split());
ans = 1;

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

Submission status: Accepted

Solution code:
n = int(input())
summit=[int(i) for i in input().split()]
#print(List)
max = summit[0]
sum = 1
for i in range(n-1):
    if max <= summit[i+1]:
        #print(max,summit[i+1])
        max = summit[i+1]
        sum = sum + 1
print(sum)

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


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)

Submission status: Accepted

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

ans = 0
for num, i in enumerate(h):
    add = True
    for j in range(num):
        if h[j] > i:
            add = False
    if add:
        ans += 1

print(ans)