Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.166 s | 13 KBi |
#2 |
Correcto
|
0.155 s | 12 KBi |
#3 |
Incorrecto
|
0.132 s | 12 KBi |
#4 |
Incorrecto
|
0.161 s | 12 KBi |
#5 |
Incorrecto
|
0.156 s | 12 KBi |
#6 |
Correcto
|
0.171 s | 12 KBi |
#7 |
Correcto
|
0.157 s | 39 KBi |
#8 |
Correcto
|
0.168 s | 12 KBi |
#9 |
Incorrecto
|
0.142 s | 12 KBi |
#10 |
Correcto
|
0.166 s | 17 KBi |
#11 |
Correcto
|
0.183 s | 12 KBi |
#12 |
Correcto
|
0.203 s | 20 KBi |
import java.util.Scanner; class Main { public static void main(String[] args) { int num = Integer.MIN_VALUE; int aux; boolean sorted = true; Scanner scan = new Scanner(System.in); short n = scan.nextShort(); for (short i=0; i<n; i++){ aux = scan.nextInt(); sorted = aux >= num; num = aux; } scan.close(); System.out.println(sorted ? "Ordenado" : "Desordenado"); } }