Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.049 s | 6 KBi |
#2 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.048 s | 6 KBi |
#3 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.058 s | 6 KBi |
#4 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.047 s | 6 KBi |
#5 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.05 s | 7 KBi |
#6 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.051 s | 7 KBi |
#7 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.068 s | 6 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.036 s | 6 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.051 s | 7 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.057 s | 7 KBi |
#11 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.035 s | 6 KBi |
#12 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.035 s | 6 KBi |
#13 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.052 s | 7 KBi |
#14 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 /box/script.js:2 const rl = readline.createInterface({ ^ TypeError: readline.createInterface is not a function at Object.<anonymous> (/box/script.js:2:21) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11 |
0.055 s | 7 KBi |
const readline = ('readline') const rl = readline.createInterface({ input: process.stdin, output: process.stdout }) let lineCounter = 0; let initialArray; let subTotalsArray; function sumSubTotals(initialArray) { let currentSum = 0; for(let i = 0; i < initialArray.length; i++) { currentSum = currentSum + i subTotalsArray.push(currentSum) } } function sumSubArray(fromIndex, toIndex){ const fromTotal = subTotalsArray[fromIndex - 1]; const toTotal = subTotalsArray[toIndex] return toTotal - fromTotal } rl.on("line", (line) => { lineCounter++; if (lineCounter === 2) { // Run the initial algorithm initialArray = line.split(" ").map(Number); sumSubTotals(initialArray) } if (lineCounter > 3) { // these are the inputs Q & P const [Q, P] = line.split(" ").map(Number); console.log(sumSubArray(Q, P)) } })