Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.004 s | 4 KBi |
#2 |
Correcto
|
0.003 s | 4 KBi |
#3 |
Incorrecto
|
0.008 s | 5 KBi |
#4 |
Correcto
|
0.011 s | 7 KBi |
#5 |
Correcto
|
0.003 s | 6 KBi |
#6 |
Correcto
|
0.004 s | 6 KBi |
#7 |
Correcto
|
0.01 s | 6 KBi |
#8 |
Incorrecto
|
0.008 s | 5 KBi |
#9 |
Correcto
|
0.004 s | 5 KBi |
#10 |
Correcto
|
0.004 s | 4 KBi |
#11 |
Incorrecto
|
0.004 s | 5 KBi |
#12 |
Correcto
|
0.013 s | 7 KBi |
#13 |
Correcto
|
0.004 s | 4 KBi |
#14 |
Correcto
|
0.006 s | 3 KBi |
#15 |
Correcto
|
0.022 s | 8 KBi |
#16 |
Correcto
|
0.004 s | 5 KBi |
#17 |
Incorrecto
|
0.004 s | 4 KBi |
#18 |
Correcto
|
0.02 s | 6 KBi |
#19 |
Correcto
|
0.006 s | 4 KBi |
#20 |
Correcto
|
0.006 s | 4 KBi |
#21 |
Correcto
|
0.009 s | 6 KBi |
#22 |
Incorrecto
|
0.006 s | 7 KBi |
#23 |
Correcto
|
0.005 s | 4 KBi |
#24 |
Incorrecto
|
0.005 s | 5 KBi |
#25 |
Correcto
|
0.004 s | 5 KBi |
#26 |
Incorrecto
|
0.013 s | 5 KBi |
#27 |
Correcto
|
0.004 s | 4 KBi |
#28 |
Correcto
|
0.009 s | 6 KBi |
#29 |
Correcto
|
0.004 s | 5 KBi |
#30 |
Correcto
|
0.004 s | 6 KBi |
#31 |
Correcto
|
0.004 s | 3 KBi |
#32 |
Correcto
|
0.004 s | 5 KBi |
#33 |
Correcto
|
0.005 s | 4 KBi |
#34 |
Incorrecto
|
0.005 s | 4 KBi |
#35 |
Correcto
|
0.007 s | 6 KBi |
#36 |
Correcto
|
0.004 s | 5 KBi |
package main import ( "bufio" "fmt" "math/big" "os" "strings" ) func main() { reader := bufio.NewReader(os.Stdin) numbersS, _ := reader.ReadString('\n') numbersS = strings.ReplaceAll(numbersS, "\n", "") numbers := strings.Split(numbersS, " ") n, _ := new(big.Int).SetString(numbers[0], 0) x, _ := new(big.Int).SetString(numbers[1], 0) y, _ := new(big.Int).SetString(numbers[2], 0) var resultReverse *big.Int if y.Cmp(x) < 1 { resultReverse = x.Sub(x, y) } else { resultReverse = x.Add(x, n.Sub(n, y)) } var resultNotReverse *big.Int if y.Cmp(x) > -1 { resultNotReverse = y.Sub(y, x) } else { resultNotReverse = y.Add(y, n.Sub(n, x)) } if resultNotReverse.Cmp(resultReverse) == -1 { fmt.Println(resultNotReverse) } else { fmt.Println(resultReverse) } }