Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.088 s | 16 KBi |
#2 |
Incorrecto
|
0.083 s | 16 KBi |
#3 |
Incorrecto
|
0.089 s | 16 KBi |
#4 |
Incorrecto
|
0.09 s | 16 KBi |
#5 |
Incorrecto
|
0.088 s | 16 KBi |
#6 |
Correcto
|
0.167 s | 12 KBi |
#7 |
Correcto
|
0.089 s | 16 KBi |
#8 |
Correcto
|
0.158 s | 13 KBi |
#9 |
Incorrecto
|
0.084 s | 16 KBi |
#10 |
Incorrecto
|
0.144 s | 12 KBi |
#11 |
Correcto
|
0.103 s | 16 KBi |
#12 |
Correcto
|
0.174 s | 12 KBi |
import java.util.Scanner; import java.util.List; import java.util.ArrayList; import java.util.Arrays; public class Main { public static void main(String[] args) { Scanner line = new Scanner(System.in); Boolean listVerify[]; int lineNumber = 0; int listLengthInputInt = 0; while (line.hasNextLine()) { if (lineNumber == 0) { String listLengthInput = line.nextLine(); listLengthInputInt = Integer.parseInt(listLengthInput); lineNumber++; } else { String[] numbersList = line.nextLine().split("\\s"); listVerify = new Boolean[listLengthInputInt]; for (int i = 0; i < listLengthInputInt - 1; i++) { int firstNumber = Integer.parseInt(numbersList[i]); int secondNumber = Integer.parseInt(numbersList[i++]); listVerify[i] = firstNumber > secondNumber; } if (Arrays.asList(listVerify).contains(true)) { System.out.println("Desordenado"); } else { System.out.println("Ordenado"); } } } line.close(); } }