Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.002 s | 5 KBi |
#2 |
Correcto
|
0.002 s | 5 KBi |
#3 |
Correcto
|
0.002 s | 5 KBi |
#4 |
Correcto
|
0.003 s | 4 KBi |
#5 |
Correcto
|
0.004 s | 52 KBi |
#6 |
Correcto
|
0.002 s | 5 KBi |
#7 |
Correcto
|
0.003 s | 9 KBi |
#8 |
Correcto
|
0.002 s | 4 KBi |
#9 |
Correcto
|
0.004 s | 53 KBi |
#10 |
Correcto
|
0.002 s | 5 KBi |
#11 |
Correcto
|
0.002 s | 5 KBi |
#12 |
Correcto
|
0.006 s | 52 KBi |
package main import ( "fmt" "bufio" "os" "strings" "strconv" ) func main() { in := bufio.NewScanner(os.Stdin) in.Scan() ln := in.Text() N, _ := strconv.Atoi(ln) var a []int in.Scan() ln = in.Text() values := strings.Split(ln, " ") for _, value := range values { v, _ := strconv.Atoi(value) a = append(a, v) } sorted := true for i := 0; i + 1 < N; i++ { if a[i] > a[i+1] { sorted = false break } } if sorted { fmt.Print("Ordenado") } else { fmt.Print("Desordenado") } }