Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.137 s | 28 KBi |
#2 |
Correcto
|
0.156 s | 54 KBi |
#3 |
Correcto
|
0.121 s | 13 KBi |
#4 |
Correcto
|
0.14 s | 14 KBi |
#5 |
Correcto
|
0.124 s | 15 KBi |
#6 |
Incorrecto
|
0.152 s | 14 KBi |
#7 |
Incorrecto
|
0.168 s | 12 KBi |
#8 |
Incorrecto
|
0.117 s | 17 KBi |
#9 |
Correcto
|
0.155 s | 21 KBi |
#10 |
Correcto
|
0.194 s | 12 KBi |
#11 |
Correcto
|
0.147 s | 13 KBi |
#12 |
Correcto
|
0.153 s | 14 KBi |
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc= new Scanner(System.in); int N = sc.nextInt(); int numberArray[] = new int[N]; for(int i = 0; i < N; i++) { numberArray[i] = sc.nextInt(); } sc.close(); boolean orderArray = true; for (int i = 0; i < N - 1; i++) { if (numberArray[i] < numberArray[i + 1]){ orderArray = true; }else { orderArray = false; break; } } if (orderArray==true){ System.out.println("Ordenado"); }else { System.out.println("Desordenado"); } } }