Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.079 s | 12 KBi |
#2 |
Incorrecto
|
0.061 s | 7 KBi |
#3 |
Incorrecto
|
0.023 s | 9 KBi |
#4 |
Incorrecto
|
0.079 s | 14 KBi |
#5 |
Incorrecto
|
0.068 s | 7 KBi |
#6 |
Incorrecto
|
0.084 s | 13 KBi |
#7 |
Incorrecto
|
0.101 s | 24 KBi |
#8 |
Incorrecto
|
0.02 s | 7 KBi |
#9 |
Incorrecto
|
0.024 s | 6 KBi |
#10 |
Incorrecto
|
0.07 s | 13 KBi |
#11 |
Incorrecto
|
0.088 s | 13 KBi |
#12 |
Incorrecto
|
0.028 s | 6 KBi |
#13 |
Incorrecto
|
0.024 s | 7 KBi |
#14 |
Incorrecto
|
0.027 s | 6 KBi |
#15 |
Incorrecto
|
0.02 s | 7 KBi |
#16 |
Incorrecto
|
0.019 s | 7 KBi |
#17 |
Correcto
|
0.019 s | 7 KBi |
#18 |
Incorrecto
|
0.029 s | 7 KBi |
#19 |
Tiempo límite excedido
|
1.539 s | 118 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.519 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.375 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.358 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.361 s | 125 KBi |
#24 |
Tiempo límite excedido
|
1.508 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.355 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.377 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.543 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.373 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 |
1.008 s | 125 KBi |
#30 |
Tiempo límite excedido
|
1.509 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 |
1.076 s | 125 KBi |
#32 |
Tiempo límite excedido
|
1.507 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.551 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.978 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.535 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 = Array.from(Array(circleLength).keys()); 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 - 1; leftWay = circleCells.slice(0, goal).length + circleCells.slice(position, circleLength.length - 1).length - 1; } else { rightWay = circleCells.slice(position, circleLength - 1).length + circleCells.slice(0, goal).length leftWay = circleCells.slice(goal, position).length - 1 } if (rightWay < leftWay) { console.log(rightWay); } else { console.log(leftWay); } }