Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.169 s | 14 KBi |
#2 |
Correcto
|
0.154 s | 14 KBi |
#3 |
Correcto
|
0.168 s | 34 KBi |
#4 |
Correcto
|
0.205 s | 13 KBi |
#5 |
Correcto
|
0.203 s | 33 KBi |
#6 |
Incorrecto
|
0.202 s | 13 KBi |
#7 |
Incorrecto
|
0.219 s | 37 KBi |
#8 |
Incorrecto
|
0.149 s | 23 KBi |
#9 |
Correcto
|
0.272 s | 14 KBi |
#10 |
Correcto
|
0.26 s | 15 KBi |
#11 |
Incorrecto
|
0.278 s | 15 KBi |
#12 |
Incorrecto
|
0.199 s | 36 KBi |
import java.util.*; public class Main { public static void main(String[] args) { String numero1, numero2; Scanner numeros = new Scanner(System.in); numero1 = numeros.nextLine(); numero2=""; numero2 += numeros.nextLine(); numeros.close(); String[] numbers = numero2.split(" "); String temp; for (int i=0; i < numbers.length; i++){ for (int j=0; j < numbers.length; j++){ if(Integer.parseInt(numbers[j]) > Integer.parseInt(numbers[i])){ temp = numbers[i]; numbers[i] = numbers[j]; numbers[j] = temp; } } } String valores=""; for(int k=0;k < numbers.length; k++){ valores+=numbers[k] + " "; } System.out.println((numero2.equals(valores.trim()))?"Ordernado":"Desordenado"); } }