Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.04 s | 6 KBi |
#2 |
Correcto
|
0.062 s | 6 KBi |
#3 |
Correcto
|
0.057 s | 6 KBi |
#4 |
Correcto
|
0.068 s | 6 KBi |
#5 |
Correcto
|
0.081 s | 6 KBi |
#6 |
Correcto
|
0.054 s | 7 KBi |
#7 |
Correcto
|
0.083 s | 7 KBi |
#8 |
Correcto
|
0.767 s | 16 KBi |
#9 |
Tiempo límite excedido
|
1.553 s | 21 KBi |
#10 |
Tiempo límite excedido
|
1.595 s | 21 KBi |
#11 |
Tiempo límite excedido
|
1.513 s | 21 KBi |
#12 |
Tiempo límite excedido
|
1.569 s | 24 KBi |
#13 |
Correcto
|
0.748 s | 30 KBi |
#14 |
Tiempo límite excedido
|
1.55 s | 21 KBi |
const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.question('', n => { rl.question('', numbersString => { const numbers = numbersString.split(' ').map(n => Number(n)); rl.question('', nQueries => { rl.on('line', queryString => { const query = queryString.split(' ').map(n => Number(n)); const p = query[0]; const q = query[1]; let sum = 0; for (let i = p; i <= q; i++) { sum += numbers[i]; } console.log(sum); }); }); }); });