Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.063 s | 6 KBi |
#2 |
Incorrecto
|
0.02 s | 6 KBi |
#3 |
Correcto
|
0.02 s | 7 KBi |
#4 |
Correcto
|
0.049 s | 6 KBi |
#5 |
Incorrecto
|
0.03 s | 6 KBi |
#6 |
Incorrecto
|
0.063 s | 6 KBi |
#7 |
Incorrecto
|
0.023 s | 6 KBi |
#8 |
Incorrecto
|
0.023 s | 7 KBi |
#9 |
Incorrecto
|
0.025 s | 6 KBi |
#10 |
Incorrecto
|
0.063 s | 6 KBi |
#11 |
Incorrecto
|
0.029 s | 7 KBi |
#12 |
Incorrecto
|
0.081 s | 6 KBi |
#13 |
Correcto
|
0.079 s | 6 KBi |
#14 |
Incorrecto
|
0.029 s | 6 KBi |
#15 |
Incorrecto
|
0.063 s | 6 KBi |
#16 |
Correcto
|
0.028 s | 6 KBi |
#17 |
Incorrecto
|
0.052 s | 6 KBi |
#18 |
Incorrecto
|
0.06 s | 6 KBi |
#19 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.315 s | 125 KBi |
#20 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.68 s | 125 KBi |
#21 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.519 s | 125 KBi |
#22 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.632 s | 125 KBi |
#23 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.315 s | 125 KBi |
#24 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.352 s | 125 KBi |
#25 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.51 s | 125 KBi |
#26 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.304 s | 125 KBi |
#27 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.624 s | 125 KBi |
#28 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.689 s | 125 KBi |
#29 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.323 s | 125 KBi |
#30 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.685 s | 125 KBi |
#31 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.584 s | 125 KBi |
#32 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.618 s | 125 KBi |
#33 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.492 s | 125 KBi |
#34 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.557 s | 125 KBi |
#35 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.307 s | 125 KBi |
#36 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/node-12.14.0/bin/node script.js |
0.351 s | 125 KBi |
let readline = require("readline"); let rightWay; let leftWay; process.stdin.setEncoding("utf8"); let stdin = readline.createInterface({ input: process.stdin, terminal: false, }); stdin.on("line", readLine); function readLine(line) { let input = line.split(" "); let circleLength = Number(input[0]); let circleCells = new Array(circleLength).fill(0); let position = Number(input[1]); let goal = Number(input[2]); if (position === goal) { console.log(0); } if (position < goal) { rightWay = circleCells.slice(position, goal).length - 2; leftWay = circleCells.slice(0, position).length + circleCells.slice(goal, circleLength).length; } else { leftWay = circleCells.slice(goal, position).length; rightWay = circleCells.slice(0, goal).length + circleCells.slice(position, circleLength).length - 1; } if (rightWay < leftWay) { console.log(rightWay); } else { console.log(leftWay); } }