Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.145 s | 16 KBi |
#2 |
Correcto
|
0.183 s | 12 KBi |
#3 |
Correcto
|
0.152 s | 16 KBi |
#4 |
Correcto
|
0.167 s | 16 KBi |
#5 |
Correcto
|
0.179 s | 15 KBi |
#6 |
Incorrecto
|
0.193 s | 12 KBi |
#7 |
Incorrecto
|
0.185 s | 16 KBi |
#8 |
Incorrecto
|
0.165 s | 16 KBi |
#9 |
Correcto
|
0.175 s | 16 KBi |
#10 |
Correcto
|
0.204 s | 12 KBi |
#11 |
Correcto
|
0.167 s | 16 KBi |
#12 |
Correcto
|
0.199 s | 12 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Data data = readNumsFromStdin(); for (int i = 0; i < data.totalNumbers - 1; i++) { if (data.numbers[i] >= data.numbers[i + 1]) { System.out.println("Desordenado"); return; } } System.out.println("Ordenado"); } private static Data readNumsFromStdin() { Data data = new Data(); Scanner in = new Scanner(System.in); data.totalNumbers = in.nextInt(); data.numbers = new int[data.totalNumbers]; for (int i = 0; i < data.totalNumbers; i++) { data.numbers[i] = in.nextInt(); } return data; } private static class Data { int totalNumbers; int[] numbers; } }