Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.037 s | 14 KBi |
#2 |
Correcto
|
0.037 s | 14 KBi |
#3 |
Correcto
|
0.078 s | 10 KBi |
#4 |
Correcto
|
0.035 s | 14 KBi |
#5 |
Correcto
|
0.067 s | 34 KBi |
#6 |
Incorrecto
|
0.081 s | 10 KBi |
#7 |
Incorrecto
|
0.037 s | 14 KBi |
#8 |
Incorrecto
|
0.068 s | 24 KBi |
#9 |
Correcto
|
0.04 s | 14 KBi |
#10 |
Correcto
|
0.075 s | 10 KBi |
#11 |
Incorrecto
|
0.082 s | 10 KBi |
#12 |
Incorrecto
|
0.083 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()); 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"); } } }