█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 3590

Problema 0x62 - Contar elementos mayores a X en un arreglo pequeño

  • Autor: jmarrietar
  • Fecha: 2021-03-28 23:13:33 UTC (Hace alrededor de 3 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.021 s 3 KBi
#2
Correcto
0.017 s 3 KBi
#3
Correcto
0.032 s 3 KBi
#4
Correcto
0.022 s 3 KBi
#5
Correcto
0.019 s 3 KBi
#6
Correcto
0.031 s 3 KBi
#7
Correcto
0.026 s 3 KBi
#8
Correcto
0.026 s 3 KBi
#9
Correcto
0.017 s 3 KBi
#10
Correcto
0.02 s 3 KBi
Puntos totales: 100 / 100

Código

length_array = int(input())
numbers = [int(x) for x in input().split()]
length_consults = int(input())
consults_numbers = []
for i in range(0, length_consults):
 consults_numbers.append(int(input()))

def get_consult(numbers, consult_nbr):
 counter = 0 
 for element in numbers: 
  if element> consult_nbr:
   counter = counter + 1
 return counter

for consult_nbr in consults_numbers:
 print(get_consult(numbers, consult_nbr))