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: Wrong Answer

Solution code:
n = int(input())
listNum = [int(x) for x in input().split()]
answer = []
answer.append(listNum[0])
for i in range(1,n):
    if((listNum[0] <= listNum[i]) and (listNum[i-1] <= listNum[i])):
        answer.append(i)
print(len(answer))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys
input = sys.stdin.readline

def io_generator():
	return input()

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

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

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

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

Submission status: Wrong Answer

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

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

print(res)

Submission status: Wrong Answer

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


n = 1
h = [15, 42, 12]

for i, v in enumerate(h):
    if i == 0:
        continue
    elif v < h[i-1]:
        break

print(i)

Submission status: Wrong Answer

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

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

    print(cnt)
    
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


result = 0

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

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

        if flg == 0:
            result = result + 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

H = []
h = input().split()
sum = 1

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

max = H[0]

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

print(sum)

Submission status: Wrong Answer

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

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

print(res)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(res)

Submission status: Wrong Answer

Solution code:
num = int(input())
list = [int(i) for i in input().split()]
sum = 0
for j in range(num):
  list1 = list[:j+1]
  if max(list) == list1[-1]:
    sum += 1
  else:
    pass
print(sum)

Submission status: Wrong Answer

Solution code:
n=int(input())
#s=input()
#a,b=map(int,input().split())
#A=[list(map(int,input().split()))for i in range(n)]
h=list(map(int,input().split()))
a=h[0]
cnt=1
for i in range(1,n):
    if h[i-1]<=h[i]:
        if a<=h[1]<=h[i] or a<=h[i]:
            cnt+=1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print("1")
    exit()
if N == 0:
    print('0')
    exit()
H = []
h = input().split()
sum = 1

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

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

print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
h = [int(i) for i in input().split()]
ans = 1
for i in range(n):
    if h[i-1] < h[i]:
        if h[0] == max(h):
            break
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print("1")
    exit()
H = []
h = input().split()
sum = 1

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

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

print(sum)

Submission status: Wrong Answer

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

ans = n
for i in range(2,n):
    if h[n-i] > h[n-i+1]:
        ans = i - 1
        break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

if H[0] < N:
  counter += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
data = [int(s) for s in input().split()]
for i in range(0,n-1):
    max = data[0]
    if data[i] <= data[i+1] and data[i+1] >= max:
        count += 1


print(count+1)

Submission status: Wrong Answer

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

count=0
first = H[0]
H.sort(reverse=True)

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


result = 0

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

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

        if flg == 0:
            result = result + 1

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

Submission status: Wrong Answer

Solution code:
trip = int(input())
sumiit = [int(i) for i in input().split()]
count = 1
for i in range(1, trip):
    if sumiit[0] <= sumiit[i] and sumiit[i-1] <= sumiit[i]:
        count += 1

print(count)

Submission status: Wrong Answer

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

ans = n
for i in range(2,n):
    if h[n-i] < h[n-i+1]:
        ans = i - 1
        break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
h = list(map(int, input().split()))
a = [1 for i, x in enumerate(h) if x * (i - 1) >= sum(h[:(i - 1)])]
print(sum(a))

Submission status: Wrong Answer

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

counter = 1
if(N==1):
    print(1)
    exit()
elif(N==2):
    if(H[0]<=H[1]):
        print(2)
    else:
        print(1)
    exit()

for i in range(N-1):
    check = True
    for j in range(N-2):
        if(H[j]<=H[i+1]):
            pass
        else:
            check = False
            break
    if(check):
        counter += 1

print(counter)

Submission status: Wrong Answer

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

a = 1
b = list()
for i in range(N):
    try:
        if H[i+1] - max(H[:i]) > 0:
            a += 1
        else:
            break
    except:
        pass
print(a)

Submission status: Wrong Answer

Solution code:

line = raw_input()
odd_one = 0
even_one = 0
for i, val in enumerate(line):
    if val == '1':
        if (i + 1)% 2 == 0:
            even_one += 1
        else:
            odd_one += 1

odd_zero = len(line) / 2 + 1 - odd_one
even_zero = len(line) / 2 - even_one

result = 0
if odd_one + even_zero > even_one + odd_zero:
    result = even_one + odd_zero
else:
    result = odd_one + even_zero
print result

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
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 [int(x) for x in sys.stdin.readline().split()]
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 pf(s): return print(s, flush=True)

N = _I()
H = LI()

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

Submission status: Wrong Answer

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

#一番西がもっとも高い山ならその時点で終了
if max(h) == h[0]:
    print(counter)
else:
    for i in range(n):
        #print(h[0:i+1])
        h_max = max(h[0:i+1])
        if (h[i] >= h_max) and (h[i] > h[0]):
            #print(h[i])
            counter += 1
    print(counter)

Submission status: Wrong Answer

Solution code:
N = int(input())

H = []
h = input().split()
sum = 1

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

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

print('\n')
print(sum)
print('\n')

Submission status: Wrong Answer

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

ans = n
for i in range(2,n+1):
    if h[n-i] < h[n-i+1]:
        ans = i - 1
        break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
h = list(map(int, input().split()))
a = [1 for i, x in enumerate(h) if x * i >= sum(h[:(i - 1)])]
print(sum(a))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

a = 1
b = list()
for i in range(N):
    try:
        if H[i+1] - max(H[i]) > 0:
            a += 1
        else:
            break
    except:
        pass
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

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

#一番西がもっとも高い山ならその時点で終了
if max(h) == h[0]:
    print(counter)
else:
    for i in range(n):
        print(h[0:i+1])
        h_max = max(h[0:i+1])
        if (h[i] >= h_max) and (h[i] > h[0]):
            #print(h[i])
            counter += 1
    print(counter)

Submission status: Wrong Answer

Solution code:
N = int(input())
H = list(input().split())
num = 0
for A in range(N):
  tf = 1
  if A == 1:
    num+= 1
    continue
  for B in range(A + 1):
    if (H[A]) < (H[B]):
      tf = 0
  if tf:
    num += 1
print("{}".format(num))

Submission status: Wrong Answer

Solution code:
N = int(input())
H = list(map(int, input().split()))
cnt = 1
for Hi in range(1, len(H)):
    if H[Hi] >= H[Hi-1] and H[0] < H[Hi]:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
H = input().split()
x = []
for i in H:
    x.append(int(i))
ans = 1
for i in range(N - 1):
    if x[i] <= x[i + 1]:
        ans = ans + 1
    else:
        break
print(ans)

Submission status: Wrong Answer

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

a = 1
b = list()
for i in range(N):
    try:
        if H[i+1] - H[i] > 0:
            a += 1
        else:
            break
    except:
        pass
print(a)

Submission status: Wrong Answer

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

result = 0

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

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

        if flg == 0:
            result = result + 1

print(result)

Submission status: Wrong Answer

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

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

for i in range(N-1):
    check = True
    for j in range(N-2):
        if(H[j]<=H[i+1]):
            pass
        else:
            check = False
            break
    if(check):
        counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
N = int(input())
H = input().split()
h = [int(k) for k in H]
l = []
ans = 1
for i in range(len(H)-1):
  l.append(h[i])
  
  if h[i+1] > max(l):
    ans += 1
  
print(ans)

Submission status: Wrong Answer

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

a = 1
b = list()
for i in range(N):
    try:
        if H[i] - H[i-1] > 0:
            a += 1
        else:
            break
    except:
        pass
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

H = []
h = input().split()
sum = 1

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

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

print('\n')
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
H = list(input().split())
num = 0
for A in range(N):
  tf = 1
  if A == 1:
    num+= 1
    continue
  for B in range(A + 1):
    if (H[A]) < (H[B]):
      tf = 0
  if tf:
    num += 1
print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in range(N)]
sum = 0
max = -1
for i in range(N):
    if A[i] >= max:
      sum += 1
      max = A[i]
      
print(sum)

Submission status: Wrong Answer

Solution code:
line_len = int(input())
s = input().rstrip().split(' ')
inns = []
ans = 1
total = 0
for i in range(line_len):
    inns.append(s[i])

for i in range(1,line_len):
    for x in range(i):
        total = 1
        if inns[x] > inns[i]:
            total = 0
            break
    ans = ans + total
print(ans)

Submission status: Wrong Answer

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

a = 1
b = list()
for i in range(N+1):
    if H[i] - H[i-1] > 0:
        a += 1
    else:
        break

Submission status: Wrong Answer

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

a = 0
b = 0

for i in range(n):
  for j in range(0, i-1):
    if h[j] >= h[i]:
      break
    else:
      a = a + 1
  a = 0
  if a == i:
    b = b + 1

print(b)

Submission status: Wrong Answer

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

result = 0

# for j in range(0,2):
#     print(j)


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

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

        if flg == 0:
            result = result + 1

print(result)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

count = 0
for i in range(len(HList)) :
    if i == 0 :
        count += 1
    elif HList[i] >= stn and HList[i] >= HList[i-1] :
        count += 1
        if stn > HList[i] :
            stn = HList[i]

print(count)
print()

Submission status: Wrong Answer

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

counter = 1
for i in range(N-1):
    check = True
    for j in range(N-2):
        if(H[j]<=H[i+1]):
            pass
        else:
            check = False
            break
    if(check):
        counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

def main():
	N = int(input())
	H = input().split(" ")

	ans = 0
	max = 0
	for i, val in enumerate(H):
		if i == 0:
			ans += 1
			max = val
			continue
		if max < val:
			max = val
		if max <= H[i]:
			ans += 1

	print(ans)
	print()



	
	
if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
line_len = int(input())
s = input().rstrip().split(' ')
inns = []
ans = 1
for i in range(line_len):
    inns.append(s[i])

for i in range(1,line_len):
    for x in range(i):
        total = 1
        if inns[x] > inns[i]:
            total = 0
            break
    ans = ans + total
print(ans)

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

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

count = 0
for i in range(len(HList)) :
    if i == 0 :
        count += 1
    elif HList[i] >= stn and HList[i] >= HList[i-1] :
        count += 1
        if stn > HList[i] :
            stn = HList[i]

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = 0

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

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
listNum = [int(x) for x in input().split()]
answer = []
for i in range(n-1):
    if(listNum[0] <= listNum[i]):
        answer.append(i)
print(len(answer))

Submission status: Wrong Answer

Solution code:
N = int(input())

H = []
h = input().split()
sum = 1

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

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

print(sum)

Submission status: Wrong Answer

Solution code:
def split_returner(chardata):
        chardata = str(chardata).split(" ")
        for i in range(0,len(chardata)):
            chardata[i] = int(chardata[i])
        return chardata
higher = input()
ab = split_returner(str(input()))
result = 0
for i in range(len(ab)):
    if ab[i] >= ab[0] and ab[i] >= ab[i-1]:
        for k in range(0,i-1):
            if ab[i] <= ab[k]:
                break       
        result+= 1
    else:
        pass
print(result)

Submission status: Wrong Answer

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

#一番西がもっとも高い山ならその時点で終了
if max(h) == h[0]:
    print(counter)
else:
    for i in range(n):
        if h[i] > h[0]:
            #print(h[i])
            counter += 1
    print(counter)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in range(N)]
sum = 0
max = 0
for i in range(N):
    if A[i] >= max:
      sum += 1
      max = A[i]
      
print(sum)

Submission status: Wrong Answer

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

ans = 1
m = n-1
tall = h[0]

for i in range(m):
    if h[i+1] >= tall:
        ans += 1
        tall = h[i+1]
    else:
        continue
        

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N= input()
highs = input().split()
count = 1
for i in range(1, len(highs)):
    if highs[i] >= max(highs[0:i]):
        count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0

hs_len = len(Hs)
for i, H in enumerate(Hs):
    flag = True
    if i == 0:
        pass
    else:
        for j in range(i, 0, -1):
            if Hs[j-1] > H:
                flag = False
                break
    if flag:
        count += 1

print(count)

Submission status: Wrong Answer

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

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

    print(counter)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = input()
h = raw_input().split()
count = 0
max_h = h[0]

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

print count + 1

Submission status: Wrong Answer

Solution code:
line_len = int(input())
s = input().rstrip().split(' ')
inns = []
ans = 1
for i in range(line_len):
    inns.append(s[i])

for i in range(1,line_len):
    for x in range(i+1):
        total = 1
        if inns[x] > inns[i]:
            total = 0
    ans = ans + total
print(ans)

Submission status: Wrong Answer

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

h1 = H[0]
cnt = 1
ind = 1
for i in range(2,N):
  for h in H[ind:i]:
    #print(h,H[i])
    if h <= H[i] and h1 <= H[i]:
      #h1,h,H[i]
      cnt += 1
      ind += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 1
m = n - 1

for i in range(m):
    if h[i+1] >= h[i]:
        ans += 1
    else:
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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-1]):
        cnt += 1
if cnt > N:
    print(N)
else:
    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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
c

Submission status: Wrong Answer

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

def check(H):
  H_max = max(H_li)
  max_indexs = ([i for i, x in enumerate(H_li) if x == H_max])

  if len(max_indexs) > 1:
    max_index = max(max_indexs)
    min_index = min(max_indexs)

    return min_index + len(max_indexs)

  else:
    return max_indexs[0] + 1


S = check(H_li)
 
print(S)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

def main():
	N = int(input())
	H = input().split(" ")

	ans = 0
	max = 0
	for i, val in enumerate(H):
		if i == 0:
			ans += 1
			max = val
			continue
		if max < val:
			max = val
		if max <= H[i]:
			ans += 1

	print(ans)



	
	
if __name__ == "__main__":
	main()

Submission status: Wrong Answer

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

ans=1
cnt=0
for i in range(n-1):
  for j in range(i):
    if h[j]<=h[i+1]:
      cnt+=1
    else:
      break
    if cnt==i:
      ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
li = list(map(int,input().split()))
i=0
c=0
a=0
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: Wrong Answer

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

    maxHeight = max(H)
    counter = 0
    for i, v in enumerate(H):
        if v < maxHeight:
            counter += 1
        elif v == maxHeight:
            break

    for i, v in enumerate(H):
        if v == maxHeight:
            counter += 1

    print(counter)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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: Wrong Answer

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-1]):
        cnt += 1

print(cnt)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
N = int(input())
H = list(map(int, input().split()))
flag = True
cou = 1
while flag:
    MaxH = max(H)
    if H.index(MaxH) == 0:
        flag = False
    else:
        H = H[:MaxH]
        cou += 1

print(cou)

Submission status: Wrong Answer

Solution code:
n=int(input())
#s=input()
#a,b=map(int,input().split())
#A=[list(map(int,input().split()))for i in range(n)]
h=list(map(int,input().split()))
a=h[0]
cnt=1
for i in range(1,n):
    if h[i-1]<=h[i] and a<=h[i] and h[1]<=h[i]:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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[0]
print(count)