Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.133 s | 22 KBi |
#2 |
Correcto
|
0.134 s | 14 KBi |
#3 |
Incorrecto
|
0.326 s | 43 KBi |
#4 |
Correcto
|
0.248 s | 14 KBi |
#5 |
Incorrecto
|
0.13 s | 13 KBi |
#6 |
Incorrecto
|
0.238 s | 24 KBi |
#7 |
Correcto
|
0.12 s | 13 KBi |
#8 |
Incorrecto
|
0.126 s | 14 KBi |
#9 |
Incorrecto
|
0.134 s | 15 KBi |
#10 |
Incorrecto
|
0.129 s | 15 KBi |
#11 |
Correcto
|
0.144 s | 22 KBi |
#12 |
Correcto
|
0.248 s | 14 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); boolean status=false; int size = scanner.nextInt(); int [] numbers= new int[size]; for(int i=0;i<size;i++){ numbers[i]=scanner.nextInt(); } for(int j=0;j<size-1;j++){ if(numbers[j]<numbers[j+1]){ status=true; }else{ break; } } if (status==true) { System.out.println("Ordenado"); } else { System.out.println("Desordenado"); } } }