Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.054 s | 11 KBi |
#2 |
Correcto
|
0.052 s | 6 KBi |
#3 |
Correcto
|
0.05 s | 6 KBi |
#4 |
Correcto
|
0.056 s | 6 KBi |
#5 |
Correcto
|
0.054 s | 6 KBi |
#6 |
Correcto
|
0.054 s | 6 KBi |
#7 |
Correcto
|
0.088 s | 33 KBi |
#8 |
Correcto
|
0.053 s | 6 KBi |
#9 |
Correcto
|
0.058 s | 6 KBi |
#10 |
Correcto
|
0.053 s | 6 KBi |
#11 |
Correcto
|
0.05 s | 6 KBi |
#12 |
Correcto
|
0.067 s | 6 KBi |
#13 |
Correcto
|
0.05 s | 6 KBi |
#14 |
Incorrecto
|
0.053 s | 6 KBi |
#15 |
Incorrecto
|
0.074 s | 31 KBi |
#16 |
Correcto
|
0.044 s | 6 KBi |
#17 |
Correcto
|
0.059 s | 6 KBi |
#18 |
Correcto
|
0.055 s | 6 KBi |
#19 |
Correcto
|
0.056 s | 6 KBi |
#20 |
Correcto
|
0.067 s | 6 KBi |
#21 |
Correcto
|
0.056 s | 6 KBi |
#22 |
Incorrecto
|
0.052 s | 7 KBi |
#23 |
Incorrecto
|
0.068 s | 6 KBi |
#24 |
Incorrecto
|
0.049 s | 6 KBi |
#25 |
Correcto
|
0.058 s | 7 KBi |
#26 |
Correcto
|
0.056 s | 6 KBi |
#27 |
Correcto
|
0.047 s | 6 KBi |
#28 |
Correcto
|
0.05 s | 6 KBi |
#29 |
Correcto
|
0.062 s | 6 KBi |
#30 |
Correcto
|
0.051 s | 6 KBi |
#31 |
Incorrecto
|
0.075 s | 6 KBi |
#32 |
Incorrecto
|
0.061 s | 6 KBi |
#33 |
Correcto
|
0.049 s | 6 KBi |
#34 |
Incorrecto
|
0.055 s | 6 KBi |
#35 |
Incorrecto
|
0.056 s | 6 KBi |
#36 |
Correcto
|
0.06 s | 6 KBi |
process.stdin.on('data', data => { const inputString = data.toString(); const input = inputString.split(' ').map(x => Number(x)); const N = input[0]; const X = input[1]; const Y = input[2]; let position; let clockwise; position = Math.max(Y, N-1); clockwise = (position - X); if (position !== Y) { clockwise += (Y + 1); } let antiClockwise; if (Y <= X) { antiClockwise = X - Y; } else { antiClockwise = X + (N - Y); } console.log(Math.min(clockwise, antiClockwise)); process.exit(); });