Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.081 s | 9 KBi |
#2 |
Correcto
|
0.089 s | 9 KBi |
#3 |
Correcto
|
0.084 s | 9 KBi |
#4 |
Correcto
|
0.096 s | 9 KBi |
#5 |
Correcto
|
0.114 s | 9 KBi |
#6 |
Correcto
|
0.088 s | 9 KBi |
#7 |
Correcto
|
0.101 s | 9 KBi |
#8 |
Correcto
|
0.155 s | 9 KBi |
#9 |
Correcto
|
0.236 s | 13 KBi |
#10 |
Correcto
|
0.318 s | 13 KBi |
#11 |
Correcto
|
0.208 s | 13 KBi |
#12 |
Correcto
|
0.244 s | 13 KBi |
#13 |
Correcto
|
0.231 s | 13 KBi |
#14 |
Correcto
|
0.234 s | 13 KBi |
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