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

Envío 3012

Problema 0x25 - Suma de un subarreglo grande

  • Autor: davidtoca
  • Fecha: 2021-02-15 02:00:03 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:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.079 s 9 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.085 s 9 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.076 s 9 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.096 s 9 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.103 s 9 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.081 s 9 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.106 s 9 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.102 s 9 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.102 s 9 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.115 s 9 KBi
#11
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.123 s 9 KBi
#12
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.129 s 10 KBi
#13
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.078 s 9 KBi
#14
Error en tiempo de ejecución (NZEC)
Exited with error status 1
script.rb:3: syntax error, unexpected '.', expecting literal content or terminator or tSTRING_DBEG or tSTRING_DVAR
array = gets.split.map(&:.to_i)
                         ^
0.112 s 9 KBi
Puntos totales: 0 / 100

Código

n = gets.to_i

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

cases = gets.to_i

total = 0

array.map!{ |numb|
    total+=numb
    total
}

cases.times do

    p, q = gets.split.map(&:.to_i)

    if p == 0
        puts array[q]
    else
        puts array[q] - array[p-1]
    end


end