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 (i) for i in input().split()]

ans = 0
max_h = 0
for i in h:
  if i >= max_h:
    ans += 1
    max_h = i
    
print(ans)

Submission status: Accepted

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

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

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



if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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


H_max = 0
ans = 0
for h in H:
    if H_max <= h:
        H_max = h
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, H: "List[int]"):

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


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    H = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, H)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

m=0
ct=0
for i in range(N):
	if m<=h[i]:
		ct+=1
	m=max(m,h[i])
print(ct)

Submission status: Accepted

Solution code:
n=int(input())
Hs=[]
cnt=0
for h in input().split():
	h = int(h)
	Hs.append(h)
	if max(Hs) == h:
		cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int, H: "List[int]"):
    ret = 0
    for i in range(N):
        no = False
        for j in range(0, i):
            if H[i] < H[j]:
                no = True
                break
        if not no:
            ret += 1
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    H = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, H)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#B問題
N=int(input())
H=list(map(int,input().split()))
count=0
hot=[]
for i in range(N):
    if i == 0:
        count+=1
        hot.append(H[0])
    else:
        if max(hot) <= H[i]:
            count+=1
        hot.append(H[i])
print(count)

Submission status: Accepted

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

cnt = 0
max_r = 0

for h in h_list:
    if max_r <= h:
        cnt += 1
    max_r = max(max_r, h)

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Max = 0
ans = 0

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

print(ans)

Submission status: Accepted

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

c=0

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

print(c)

Submission status: Accepted

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

ans = 0
maxH = 0
for H in Hs:
    if maxH <= H:
        ans += 1
        maxH = H

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

result = 0

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

print(result)

Submission status: Accepted

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


ans = 0
highest = -1
for h in H_list:
    if highest <= h:
        ans +=1
        highest = h
    else:
        pass
    
print(ans)

Submission status: Accepted

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

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()
H = map(int, raw_input().split())
num = ans = 0
for i in range(N):
    if H[i] >= num:
        ans += 1
    num = max(num, H[i])
print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

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

ma = 0
ct = 0
for a in arr:
    if ma <= a:
        ma = a
        ct +=1

print(ct)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ms = list(map(int, input().split()))
last = 0
cnt = 0
for mt in ms:
  if mt >= last:
    cnt += 1
    last = mt
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
from collections import deque, defaultdict as ddic
from itertools import combinations, permutations, product
import bisect
import heapq

rs = lambda: stdin.readline().strip()
ri = lambda: int(rs())
rsl = lambda: stdin.readline().split()
rim = lambda: map(int, rsl())
ril = lambda: list(rim())

n = ri()
heights = rim()
ans = 0
maximum = float('-inf')
for h in heights:
    if h >= maximum:
        ans += 1
        maximum = h

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    n = int(input())
    h = [int(i) for i in input().split()]
    ans = 0
    for i in range(n):
        if h[i] >= max(h[:i+1]):
            ans += 1
    print(ans)

main()

Submission status: Accepted

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

ans = 1
for i in range(1, N):
    for j in range(i):
        if h[i] < h[j]:
            break
    else:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [tuple(map(int, l.split())) for l in sys.stdin]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def main():
    n = I()
    a = LI()
    r = 1
    m = a[0]
    for i in range(1,n):
        if m <= a[i]:
            r += 1
            m = a[i]

    return r


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
H = [int(_) for _ in input().split()]
tmp = 0
cnt = 0

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

print(cnt)

Submission status: Accepted

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

max=0;
answer=0;

for i in A:
    if(max<=i):
        answer+=1;
        max=i;

print(answer);

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = 1
    arr = list(map(int, input().split()))
    for i in range(1, n):
        for j in range(i):
            if arr[j] > arr[i]:
                break
            if j == i - 1:
                ans += 1
    print(ans)
    return 0
main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())
p=0
c=0
for i in range(n):
    if p<=a[i]:
        c+=1
        p=a[i]
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# import bisect
# import math
# import itertools
# import numpy as np
# import collections

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e, p = range, enumerate, print
    ip = IP()
    id = Idea()
    mod = 10 ** 9 + 7

    """この下から書いてね"""
    n = ip.I()
    h = ip.IL()
    ma = 0
    ans = 0
    for x in h:
        if x >= ma:
            ans += 1
        ma = max(ma, x)
    p(ans)


main()

Submission status: Accepted

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

ma = 0
Ans = 0
for i in H:
  if i >= ma:
    ma = i
    Ans += 1

print(Ans)

Submission status: Accepted

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

limit, count = 0, 0
for h in H:
    if h >= limit:
        count += 1
    limit = max(limit, h)

print count

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,b = LI()
    if a == b:
        print(2*a)
    else:
        print(2*max(a,b)-1)
    return

#B
def B():
    n = I()
    h = LI()
    m = h[0]
    ans = 1
    for i in range(1,n):
        if m <= h[i]:
            ans += 1
            m = h[i]
    print(ans)
    return

#C
def C():
    n = I()

    return

#D
def D():
    n = I()

    return

#Solve
if __name__ == "__main__":
    B()

Submission status: Accepted

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

maxi = arr[0]
ans = 0
for num in arr:
    if maxi > num:
        pass
    else:
        ans += 1
        maxi = num

print(ans)

Submission status: Accepted

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

ans = 1
tmp = H[0]

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

print(ans)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
h = list(li())
hmax = 0

ans = 0
for hi in h:
    if hi >= hmax:
        ans += 1
        hmax = hi
print(ans)

Submission status: Accepted

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

mx = 0
ans = 0
for hi in h:
    if mx <= hi:
        ans += 1
        mx = hi
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime,random
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N = int(input())
H = inpl()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print (ans)

Submission status: Accepted

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

mx = 0
res = 0
for i in h:
    if mx <= i:
        res += 1
    mx = max(mx, i)
print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
hhh = list(map(int, input().split()))
tmp = -1

ans = 0
for h in hhh:
    if h >= tmp:
        ans += 1
        tmp = h
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
H=list(map(int,input()))
ans=0
m=-1000
for i in range(n):
  if m<=H[i]:
    m=H[i]
    ans+=1
print(ans)

Submission status: Runtime Error

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

c = 0

for i in h:
  t = True
  for j in range(i):
    if h[j] >= h[i]:
      t = False
      break
   c += 1

Submission status: Runtime Error

Solution code:
n=int(input())
a=int(input())
cnt=1
for i in range(n-1):
  b=int(input())
  if a<=b:
    cnt++
    a=b

print(cnt)

Submission status: Runtime Error

Solution code:
import sys
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[0]>h[1] and h[0]>h[2] and h[0]>h[3]:
        x=0
        print(1)
        sys.exit()
    if h[i]>=h[i-1]:
        x=x+1 
print(x)

Submission status: Runtime Error

Solution code:
import sys
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[0]>=h[1] and h[0]>=h[2]:
        x=0
        print(1)
        sys.exit()
    if h[i]>=h[i-1]:
        x=x+1 
print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
import math
import collections
import fractions
import itertools

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

if __name__ == '__main__':
    solve()

Submission status: Runtime Error

Solution code:
import numpy as np
import math
import collections
import fractions
import itertools

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

if __name__ == '__main__':
    solve()

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

#ifdef _DEBUG
    #include "/home/v-o_o-v/deb.h"
    #define deb(x...)cerr << "[" << #x << "] = [";_print(x);
#else
    #define deb(x...)
#endif

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin >> n;
    int h[n];
    vector<int> v;
    
    for(int i = 0; i < n; i++){
        cin >> h[i];
        if(v.empty())v.pb(h[i]);
        else if(v.back() <= h[i])v.pb(h[i]);
    }
    cout << v.size() << '\n';
    return 0;
}
// Write Here

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding = SJIS
n = int(input())
h = list(map(int, input().split()))
ans = 1
if h[0] <= h[1]:
    ans += 1
else:
    ans += 0
for i in range(2, n - 1):
    kai = 0
    for j in range(0, i - 1):
        if h[j] <= h[i]:
            kai += 1
        else:
            kai += 0
    if kai == i - 1:
        ans += 1
    else:
        ans += 0
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    H = list(map(int, input().split()))
    CNT = 1
    if H[1] >= H[0]:
        CNT += 2
        High = H[1]
    else:
        High = H[0]
    for i in range(2,N):
        if H[i]>=H[i-1] and H[i]>=High:
            CNT += 1
    print(CNT)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int, input().split()))
l = [h[0]]
ans = 1
for i in h[1:]:
        if i>=sorted(l)[-1]:
            l.append(i)
print(len(i))

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int, input().split()))
l = [h[0]]
ans = 1
for i in h[1:]:
    for j in l:
        if i>=j:
            l.append(i)
print(len(i))

Submission status: Runtime Error

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

pre = 0
ans = 0

for h in H:
  if h >= pre:
    pre = h
    ans += 1
print(ans)

Submission status: Runtime Error

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

H1 = Hlist[0]
H2 = Hlist[1]

ans = 1
if H2 >= H1:
    ans += 1

for i in range(2, N):
    if Hlist[i] >= H1 and Hlist[i] >= H2 and Hlist[i] >= Hlist[i-1]:
        ans += 1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
li=[int(i) for i in input().split()]
count=0
if li[0]<li[1]:
    p=[x for x in li if x>=li[0] and x>=li[1]]
    print(len(p)+1)
else:
    p=[x for x in li if x>=li[0] and x>=li[1]]
    print(len(p))

Submission status: Runtime Error

Solution code:
N = int(input())
heights = [int(i) for i in input().split(' ')]
fm = heights[0]
res = 1
for i in len(heights):
    if i == 0:
        continue
    if heights[i] > fm:
        res += 1
print(res)

Submission status: Runtime Error

Solution code:
N = int(input())
heights = [int(i) for i in input().split(' ')]
fm = heights[0]
res = 1
for i in len(heights):
	if i == 0:
    	continue
    if heights[i] > fm:
        res += 1
print(res)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
high = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    if max>=high[i]:
        ans += 1
        max = high[i]

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

ans = sum(viewable)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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