Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.141 s | 14 KBi |
#2 |
Correcto
|
0.15 s | 21 KBi |
#3 |
Correcto
|
0.166 s | 12 KBi |
#4 |
Correcto
|
0.143 s | 14 KBi |
#5 |
Correcto
|
0.157 s | 16 KBi |
#6 |
Correcto
|
0.132 s | 15 KBi |
#7 |
Correcto
|
0.192 s | 14 KBi |
#8 |
Correcto
|
0.172 s | 13 KBi |
#9 |
Correcto
|
0.155 s | 15 KBi |
#10 |
Correcto
|
0.158 s | 14 KBi |
#11 |
Correcto
|
0.314 s | 16 KBi |
#12 |
Correcto
|
0.281 s | 25 KBi |
#13 |
Correcto
|
0.322 s | 23 KBi |
#14 |
Correcto
|
0.286 s | 19 KBi |
#15 |
Correcto
|
0.31 s | 20 KBi |
#16 |
Correcto
|
0.357 s | 18 KBi |
#17 |
Correcto
|
0.299 s | 17 KBi |
#18 |
Correcto
|
0.274 s | 18 KBi |
#19 |
Correcto
|
0.262 s | 18 KBi |
#20 |
Correcto
|
0.273 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(); // Selection sort for (int i = 0; i < N-1; i++) { int minimumValueIndex = i; for (int j = i+1; j < N; j++) { if (numberArray[j] < numberArray[minimumValueIndex]) { minimumValueIndex = j; } } int temp = numberArray[minimumValueIndex]; numberArray[minimumValueIndex] = numberArray[i]; numberArray[i] = temp; } for(int i = 0; i < numberArray.length; i++) { System.out.print(numberArray[i] + " "); } } }