Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.049 s | 6 KBi |
#2 |
Incorrecto
|
0.067 s | 7 KBi |
#3 |
Incorrecto
|
0.067 s | 6 KBi |
#4 |
Incorrecto
|
0.053 s | 10 KBi |
#5 |
Incorrecto
|
0.058 s | 12 KBi |
#6 |
Correcto
|
0.059 s | 6 KBi |
#7 |
Correcto
|
0.052 s | 6 KBi |
#8 |
Correcto
|
0.052 s | 6 KBi |
#9 |
Incorrecto
|
0.053 s | 6 KBi |
#10 |
Incorrecto
|
0.054 s | 6 KBi |
#11 |
Correcto
|
0.068 s | 9 KBi |
#12 |
Correcto
|
0.071 s | 6 KBi |
const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let ordenado = true; rl.question('', (n) => { rl.question('', (numbersString) => { if (numbersString.length > 0) { const numbers = numbersString.split(' '); for(let i = 1; i < numbers.lenght; i++) { if (number[i-1] > number[i]) { ordenado = false; break; } } console.log(ordenado ? 'Ordenado' : 'Desordenado'); } rl.close(); }); });