Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.153 s | 16 KBi |
#2 |
Correcto
|
0.154 s | 12 KBi |
#3 |
Correcto
|
0.162 s | 15 KBi |
#4 |
Correcto
|
0.132 s | 15 KBi |
#5 |
Correcto
|
0.179 s | 12 KBi |
#6 |
Correcto
|
0.14 s | 12 KBi |
#7 |
Correcto
|
0.168 s | 15 KBi |
#8 |
Correcto
|
0.165 s | 15 KBi |
#9 |
Correcto
|
0.183 s | 16 KBi |
#10 |
Correcto
|
0.175 s | 16 KBi |
#11 |
Correcto
|
0.184 s | 13 KBi |
#12 |
Correcto
|
0.194 s | 12 KBi |
import java.util.Scanner; /** * * @author usuario */ public class Main { public static void main(String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int size = sc.nextInt(); int[] array = new int[size]; String result = "Ordenado"; for(int i=0; i<size; i++){ int num = sc.nextInt(); array[i] = num; } for(int i=0; i<array.length; i++){ if((i+1) < array.length){ if(array[i] > array[i+1]){ result = "Desordenado"; break; } } } System.out.println(result); } }