Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.17 s | 13 KBi |
#2 |
Correcto
|
0.13 s | 14 KBi |
#3 |
Correcto
|
0.146 s | 13 KBi |
#4 |
Correcto
|
0.14 s | 14 KBi |
#5 |
Correcto
|
0.133 s | 14 KBi |
#6 |
Correcto
|
0.118 s | 12 KBi |
#7 |
Correcto
|
0.127 s | 14 KBi |
#8 |
Correcto
|
0.128 s | 13 KBi |
#9 |
Correcto
|
0.152 s | 14 KBi |
#10 |
Correcto
|
0.136 s | 12 KBi |
#11 |
Correcto
|
0.151 s | 14 KBi |
#12 |
Correcto
|
0.146 s | 14 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); int size = entrada.nextInt(); int[] array = new int[size]; for (int i = 0; i < size; i++) { array[i] = entrada.nextInt(); } int N = 1; for (int i = 0; i < size-1; i++) { if(array[i+1] < array[i]){ N = 0; } } if(N == 1){ System.out.println("Ordenado"); }else{ System.out.println("Desordenado"); } } }