Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.004 s | 7 KBi |
#2 |
Correcto
|
0.004 s | 6 KBi |
#3 |
Correcto
|
0.005 s | 5 KBi |
#4 |
Correcto
|
0.004 s | 5 KBi |
#5 |
Correcto
|
0.005 s | 5 KBi |
#6 |
Correcto
|
0.005 s | 6 KBi |
#7 |
Correcto
|
0.004 s | 6 KBi |
#8 |
Correcto
|
0.004 s | 7 KBi |
#9 |
Correcto
|
0.004 s | 4 KBi |
#10 |
Correcto
|
0.007 s | 5 KBi |
#11 |
Incorrecto
|
0.005 s | 6 KBi |
#12 |
Incorrecto
|
0.005 s | 6 KBi |
package main import ( "bufio" "fmt" "os" "strconv" "strings" ) func main() { reader := bufio.NewReader(os.Stdin) data, _ := reader.ReadString('\n') data = strings.ReplaceAll(data, "\n", "") data2, _ := reader.ReadString('\n') data2 = strings.ReplaceAll(data2, "\n", "") lenght, _ := strconv.ParseInt(data, 10, 0) number1 := 0 numbers := strings.Split(data2, " ") for number1 < int(lenght) - 1 { numberFirst := numbers[number1] numberSecond := numbers[number1+1] if numberFirst > numberSecond { fmt.Println("Desordenado") return } number1++ } fmt.Println("Ordenado") }