Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.06 s | 7 KBi |
#2 |
Incorrecto
|
0.068 s | 7 KBi |
#3 |
Incorrecto
|
0.051 s | 7 KBi |
#4 |
Incorrecto
|
0.058 s | 10 KBi |
#5 |
Incorrecto
|
0.049 s | 6 KBi |
#6 |
Incorrecto
|
0.05 s | 7 KBi |
#7 |
Incorrecto
|
0.05 s | 7 KBi |
#8 |
Incorrecto
|
0.056 s | 7 KBi |
#9 |
Incorrecto
|
0.048 s | 6 KBi |
#10 |
Incorrecto
|
0.049 s | 6 KBi |
#11 |
Incorrecto
|
0.064 s | 7 KBi |
#12 |
Incorrecto
|
0.062 s | 7 KBi |
#13 |
Incorrecto
|
0.054 s | 7 KBi |
#14 |
Incorrecto
|
0.052 s | 8 KBi |
#15 |
Incorrecto
|
0.048 s | 7 KBi |
#16 |
Incorrecto
|
0.046 s | 7 KBi |
#17 |
Incorrecto
|
0.075 s | 7 KBi |
#18 |
Incorrecto
|
0.073 s | 7 KBi |
#19 |
Incorrecto
|
0.083 s | 7 KBi |
#20 |
Incorrecto
|
0.056 s | 7 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; const n = numbers.length; 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; } } } console.log(numbers); process.exit(); }); })