Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.157 s | 15 KBi |
#2 |
Correcto
|
0.16 s | 14 KBi |
#3 |
Correcto
|
0.156 s | 14 KBi |
#4 |
Correcto
|
0.136 s | 14 KBi |
#5 |
Correcto
|
0.177 s | 13 KBi |
#6 |
Correcto
|
0.148 s | 14 KBi |
#7 |
Correcto
|
0.169 s | 14 KBi |
#8 |
Correcto
|
0.152 s | 16 KBi |
#9 |
Correcto
|
0.168 s | 13 KBi |
#10 |
Correcto
|
0.148 s | 14 KBi |
#11 |
Correcto
|
0.267 s | 17 KBi |
#12 |
Correcto
|
0.287 s | 16 KBi |
#13 |
Correcto
|
0.279 s | 18 KBi |
#14 |
Correcto
|
0.353 s | 19 KBi |
#15 |
Correcto
|
0.309 s | 20 KBi |
#16 |
Correcto
|
0.304 s | 17 KBi |
#17 |
Correcto
|
0.279 s | 17 KBi |
#18 |
Correcto
|
0.295 s | 17 KBi |
#19 |
Correcto
|
0.338 s | 19 KBi |
#20 |
Correcto
|
0.312 s | 18 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int N = sc.nextInt(); int numberArray[] = new int[N]; for(int i = 0; i < N; i++) { numberArray[i] = sc.nextInt(); } sc.close(); // Bubble sort for (int i = 0; i < N-1; i++) { for (int j = 0; j < N-i-1; j++) { if (numberArray[j] > numberArray[j+1]){ int temp = numberArray[j]; numberArray[j] = numberArray[j+1]; numberArray[j+1] = temp; } } } for(int i = 0; i < numberArray.length; i++) { System.out.print(numberArray[i] + " "); } } }