Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.136 s | 12 KBi |
#2 |
Correcto
|
0.131 s | 13 KBi |
#3 |
Correcto
|
0.162 s | 12 KBi |
#4 |
Correcto
|
0.136 s | 12 KBi |
#5 |
Correcto
|
0.329 s | 12 KBi |
#6 |
Correcto
|
0.128 s | 12 KBi |
#7 |
Correcto
|
0.156 s | 12 KBi |
#8 |
Correcto
|
0.163 s | 29 KBi |
#9 |
Correcto
|
0.137 s | 12 KBi |
#10 |
Correcto
|
0.342 s | 12 KBi |
#11 |
Correcto
|
0.395 s | 12 KBi |
#12 |
Correcto
|
0.563 s | 12 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] array = new int[n]; String result = "Ordenado"; for(int i = 0; i < n; i++) { array[i] = scanner.nextInt(); } for(int i = 0; i < n - 1; i++) { if(array[i] > array[i + 1]) { result = "Desordenado"; } } System.out.println(result); } }