Problem: 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?

Submission attempts (in order):
N = int(input())
list = []
num = 0
flag = 1
for i in range(N-1):
    list.append(i)


if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    
                flag = 0      
    num += 1

print(num)

N = int(input())
list = []
num = 0
flag = 1
for i in range(N-1):
    list.append(i)


if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    
                flag = 0      
    num += 1

print(num)

N = int(input())
list = []
num = 0
for i in range(N-1):
    list.append(i)
    if list[0] <= list[i]:
        flag = 1
    else:
        flag = 0

if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    
                flag = 0      
    num += 1

print(num)

N = int(input())
list = []
num = 0
for i in range(N-1):
    list.append(i)
    if list[0] <= list[i]:
        flag = 1
    else:
        flag = 0

if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    
                flag = 0      
    num += 1

print(num)

import random
N = random.randint(1,20)
num = 0
list = []
for i in range(0,N):
    Hi = random.randint(1,100)
    list.append(Hi)
    a = list[0]
    b = list[i]
    if a <= b:
            num += 1   
   
print(N)
print(list) 
print(num)


import random
N = random.randint(1,20)
num = 0
list = []
for i in range(0,N):
    Hi = random.randint(1,100)
    list.append(Hi)
    a = list[0]
    b = list[i]
    if a <= b:
            num += 1   
   
print(N)
print(list) 
print(num)


N = int(input())
list = []
num = 0
flag = 1
for i in range(N-1):
    list.append(i)


if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    
                flag = 0      
    num += 1

print(num)

N = int(input())
list = []
num = 0
flag = 1
for i in range(N-1):
    list.append(i)


if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    
                flag = 0      
    num += 1

print(num)

N = int(input())
list = []
num = 0
for i in range(N-1):
    list.append(i)
    if list[0] <= list[i]:
        flag = 1
    else:
        flag = 0

if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    
                flag = 0      
    num += 1

print(num)

N = int(input())
list = []
num = 0
for i in range(N-1):
    list.append(i)
    if list[0] <= list[i]:
        flag = 1
    else:
        flag = 0

if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    
                flag = 0      
    num += 1

print(num)

import random
N = random.randint(1,20)
num = 0
list = []
for i in range(0,N):
    Hi = random.randint(1,100)
    list.append(Hi)
    a = list[0]
    b = list[i]
    if a <= b:
            num += 1   
   
print(N)
print(list) 
print(num)


import random
N = random.randint(1,20)
num = 0
list = []
for i in range(0,N):
    Hi = random.randint(1,100)
    list.append(Hi)
    a = list[0]
    b = list[i]
    if a <= b:
            num += 1   
   
print(N)
print(list) 
print(num)


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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted

Accepted

Accepted

Accepted