Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.039 s | 7 KBi |
#2 |
Incorrecto
|
0.054 s | 7 KBi |
#3 |
Incorrecto
|
0.049 s | 7 KBi |
#4 |
Incorrecto
|
0.047 s | 6 KBi |
#5 |
Incorrecto
|
0.051 s | 6 KBi |
#6 |
Incorrecto
|
0.046 s | 7 KBi |
#7 |
Incorrecto
|
0.061 s | 7 KBi |
#8 |
Incorrecto
|
0.063 s | 7 KBi |
#9 |
Incorrecto
|
0.053 s | 6 KBi |
#10 |
Incorrecto
|
0.051 s | 6 KBi |
#11 |
Incorrecto
|
0.107 s | 8 KBi |
#12 |
Incorrecto
|
0.082 s | 8 KBi |
#13 |
Incorrecto
|
0.096 s | 8 KBi |
#14 |
Incorrecto
|
0.082 s | 8 KBi |
#15 |
Incorrecto
|
0.068 s | 8 KBi |
#16 |
Incorrecto
|
0.109 s | 8 KBi |
#17 |
Incorrecto
|
0.123 s | 8 KBi |
#18 |
Incorrecto
|
0.094 s | 11 KBi |
#19 |
Incorrecto
|
0.094 s | 11 KBi |
#20 |
Incorrecto
|
0.09 s | 9 KBi |
const readline = require('readline'); const rd = readline.createInterface({ input: process.stdin, output: process.stdout }); rd.question('', n => { rd.question('', numbersInput => { const numbers = numbersInput.split(' ').map(n => Number(n)); let index = 0; let ordered = false; while (index < n && !ordered) { index++; ordered = true; for (let j = 0; j < n - index; j++) { if (numbers[j] > numbers[j+1]) { ordered = false; const aux = numbers[j]; numbers[j] = numbers[j+1]; numbers[j+1] = aux; } } } for (let i = 0; i < n; i++) { console.log(numbers[i]); } process.exit(); }); })