Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.072 s | 6 KBi |
#2 |
Incorrecto
|
0.029 s | 6 KBi |
#3 |
Correcto
|
0.056 s | 7 KBi |
#4 |
Correcto
|
0.031 s | 6 KBi |
#5 |
Incorrecto
|
0.075 s | 11 KBi |
#6 |
Incorrecto
|
0.033 s | 6 KBi |
#7 |
Incorrecto
|
0.066 s | 6 KBi |
#8 |
Correcto
|
0.033 s | 6 KBi |
#9 |
Incorrecto
|
0.033 s | 6 KBi |
#10 |
Incorrecto
|
0.019 s | 7 KBi |
#11 |
Correcto
|
0.03 s | 6 KBi |
#12 |
Incorrecto
|
0.086 s | 17 KBi |
#13 |
Correcto
|
0.032 s | 6 KBi |
#14 |
Correcto
|
0.032 s | 6 KBi |
#15 |
Correcto
|
0.025 s | 6 KBi |
#16 |
Correcto
|
0.059 s | 6 KBi |
#17 |
Correcto
|
0.022 s | 7 KBi |
#18 |
Incorrecto
|
0.029 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.735 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.411 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.482 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.583 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.352 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.476 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.425 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.734 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.789 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.379 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.376 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.575 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.602 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.372 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.673 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.364 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.696 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.416 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 + 1, goal + 1).length; 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); } }