Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.005 s | 10 KBi |
#2 |
Correcto
|
0.006 s | 52 KBi |
#3 |
Correcto
|
0.004 s | 18 KBi |
#4 |
Correcto
|
0.005 s | 17 KBi |
#5 |
Correcto
|
0.003 s | 19 KBi |
#6 |
Correcto
|
0.003 s | 12 KBi |
#7 |
Correcto
|
0.006 s | 16 KBi |
#8 |
Correcto
|
0.005 s | 9 KBi |
#9 |
Correcto
|
0.003 s | 16 KBi |
#10 |
Correcto
|
0.004 s | 8 KBi |
#11 |
Correcto
|
0.03 s | 10 KBi |
#12 |
Correcto
|
0.03 s | 13 KBi |
#13 |
Correcto
|
0.084 s | 16 KBi |
#14 |
Correcto
|
0.034 s | 17 KBi |
#15 |
Correcto
|
0.033 s | 13 KBi |
#16 |
Correcto
|
0.036 s | 23 KBi |
#17 |
Tiempo límite excedido
|
1.089 s | 17 KBi |
#18 |
Correcto
|
0.935 s | 12 KBi |
#19 |
Tiempo límite excedido
|
1.049 s | 5 KBi |
#20 |
Tiempo límite excedido
|
1.044 s | 5 KBi |
package main import ( "bufio" "fmt" "os" "strconv" "strings" ) func main() { reader := bufio.NewReader(os.Stdin) n, _ := reader.ReadString('\n') n = strings.ReplaceAll(n, "\n", "") numbersS, _ := reader.ReadString('\n') numbersS = strings.ReplaceAll(numbersS, "\n", "") numbers := strings.Split(numbersS, " ") index := 0 for index < len(numbers) { number, _ := strconv.ParseInt(numbers[index], 10, 64) isAdded := false for j := index + 1; j < len(numbers); j++ { indexNumber, _ := strconv.ParseInt(numbers[j], 10, 64) if indexNumber < number { numberAux := numbers[index] numbers[index] = numbers[j] numbers[j] = numberAux isAdded = true break } } if !isAdded { index++ } } fmt.Println(strings.Join(numbers, " ")) }