Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.124 s | 13 KBi |
#2 |
Correcto
|
0.147 s | 13 KBi |
#3 |
Correcto
|
0.139 s | 14 KBi |
#4 |
Correcto
|
0.124 s | 14 KBi |
#5 |
Correcto
|
0.161 s | 13 KBi |
#6 |
Correcto
|
0.132 s | 14 KBi |
#7 |
Correcto
|
0.124 s | 13 KBi |
#8 |
Correcto
|
0.135 s | 13 KBi |
#9 |
Correcto
|
0.131 s | 14 KBi |
#10 |
Correcto
|
0.178 s | 13 KBi |
#11 |
Correcto
|
0.148 s | 23 KBi |
#12 |
Correcto
|
0.157 s | 13 KBi |
import java.util.Scanner; public class Main { public static void main(String args[]) { boolean ordenado = true; try { Scanner br = new Scanner(System.in); int N = br.nextInt(); int left = br.nextInt(); for (int i = 1; i < N && ordenado; i++) { int right = br.nextInt(); if (left > right) { ordenado = false; } left = right; } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if (ordenado) { System.out.println("Ordenado"); } else { System.out.println("Desordenado"); } } }