Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.129 s | 12 KBi |
#2 |
Incorrecto
|
0.155 s | 12 KBi |
#3 |
Incorrecto
|
0.134 s | 36 KBi |
#4 |
Incorrecto
|
0.126 s | 12 KBi |
#5 |
Incorrecto
|
0.146 s | 12 KBi |
#6 |
Correcto
|
0.081 s | 16 KBi |
#7 |
Correcto
|
0.092 s | 16 KBi |
#8 |
Correcto
|
0.173 s | 12 KBi |
#9 |
Incorrecto
|
0.101 s | 16 KBi |
#10 |
Incorrecto
|
0.089 s | 16 KBi |
#11 |
Correcto
|
0.087 s | 16 KBi |
#12 |
Correcto
|
0.065 s | 16 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++) { Integer firstNumber = Integer.valueOf(numbersList[i]); Integer SecondNumber = Integer.valueOf(numbersList[i + 1]); if (firstNumber > SecondNumber) { System.out.println("Desordenado"); break; } } System.out.println("Ordenado"); } } line.close(); } }