Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.081 s | 13 KBi |
#2 |
Correcto
|
0.088 s | 13 KBi |
#3 |
Correcto
|
0.095 s | 11 KBi |
#4 |
Correcto
|
0.092 s | 13 KBi |
#5 |
Correcto
|
0.082 s | 13 KBi |
#6 |
Correcto
|
0.074 s | 13 KBi |
#7 |
Correcto
|
0.091 s | 14 KBi |
#8 |
Correcto
|
0.07 s | 14 KBi |
#9 |
Correcto
|
0.095 s | 10 KBi |
#10 |
Correcto
|
0.093 s | 10 KBi |
#11 |
Correcto
|
0.093 s | 10 KBi |
#12 |
Correcto
|
0.082 s | 14 KBi |
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Throwable { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for(String ln; (ln = in.readLine())!= null;){ int N = Integer.parseInt(ln); StringTokenizer st = new StringTokenizer(in.readLine()); int[] values = new int[N]; for(int i=0; i<N; i++) values[i] = Integer.parseInt(st.nextToken()); boolean ordered = true; for(int i=0; ordered && i<N-1; i++) if(values[i] > values[i+1]) ordered =false; System.out.println(ordered?"Ordenado":"Desordenado"); } } }