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

Envío 2994

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

  • Autor: davidtoca
  • Fecha: 2021-02-14 15:43:04 UTC (Hace alrededor de 3 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 3:Integer (NoMethodError)
Did you mean?  times
0.105 s 9 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 10:Integer (NoMethodError)
Did you mean?  times
0.104 s 9 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 10:Integer (NoMethodError)
Did you mean?  times
0.092 s 9 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 10:Integer (NoMethodError)
Did you mean?  times
0.109 s 9 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 10:Integer (NoMethodError)
Did you mean?  times
0.089 s 9 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 30:Integer (NoMethodError)
Did you mean?  times
0.103 s 10 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 100:Integer (NoMethodError)
Did you mean?  times
0.116 s 9 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 100:Integer (NoMethodError)
Did you mean?  times
0.1 s 9 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 100:Integer (NoMethodError)
Did you mean?  times
0.088 s 9 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:8:in `<main>': undefined method `time' for 100:Integer (NoMethodError)
Did you mean?  times
0.107 s 9 KBi
Puntos totales: 0 / 100

Código

n = gets.to_i

array = gets.split.map(&:to_i)

cases = gets.to_i

cases.time do

    comp = gets.to_i
    response = 0

    array.each do |numb|
        if numb > comp
            response +=1
        end
    end
    puts response
end