Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.042 s | 14 KBi |
#2 |
Correcto
|
0.071 s | 10 KBi |
#3 |
Correcto
|
0.042 s | 13 KBi |
#4 |
Correcto
|
0.076 s | 27 KBi |
#5 |
Correcto
|
0.042 s | 14 KBi |
#6 |
Correcto
|
0.045 s | 14 KBi |
#7 |
Correcto
|
0.044 s | 13 KBi |
#8 |
Correcto
|
0.044 s | 14 KBi |
#9 |
Correcto
|
0.043 s | 14 KBi |
#10 |
Correcto
|
0.045 s | 14 KBi |
#11 |
Correcto
|
0.044 s | 14 KBi |
#12 |
Correcto
|
0.069 s | 10 KBi |
import java.io.*; import java.util.StringTokenizer; class Main { public static void main(String[] args) throws IOException{ long mayor = Long.MIN_VALUE; long contador = 0; BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(bf.readLine()); long cantidad = Long.parseLong(st.nextToken()); st = new StringTokenizer(bf.readLine()); while(st.hasMoreTokens()){ long valor = Long.parseLong(st.nextToken()); if(valor>=mayor){ mayor=valor; contador++; } } if(contador==cantidad){ System.out.println("Ordenado"); }else{ System.out.println("Desordenado"); } } }