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

Envío 6351

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

  • Autor: sricog
  • Fecha: 2022-06-21 03:52:47 UTC (Hace casi 2 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.011 s 3 KBi
#2
Correcto
0.011 s 3 KBi
#3
Correcto
0.011 s 3 KBi
#4
Correcto
0.01 s 3 KBi
#5
Correcto
0.012 s 3 KBi
#6
Correcto
0.015 s 3 KBi
#7
Correcto
0.015 s 3 KBi
#8
Correcto
0.01 s 3 KBi
#9
Correcto
0.015 s 3 KBi
#10
Correcto
0.011 s 3 KBi
Puntos totales: 100 / 100

Código

n = int(input())
nums = sorted(list(map(int,input().split())),reverse=True)
k = int(input())
temp = 0
while k:
    j = int(input())
    for i in nums:
        if i > j: 
            temp += 1
        else:
            break
    print(temp)
    k -= 1
    temp = 0