Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.049 s | 6 KBi |
#2 |
Incorrecto
|
0.052 s | 7 KBi |
#3 |
Incorrecto
|
0.077 s | 6 KBi |
#4 |
Incorrecto
|
0.076 s | 7 KBi |
#5 |
Incorrecto
|
0.068 s | 6 KBi |
#6 |
Correcto
|
0.052 s | 6 KBi |
#7 |
Correcto
|
0.068 s | 7 KBi |
#8 |
Correcto
|
0.053 s | 6 KBi |
#9 |
Incorrecto
|
0.058 s | 6 KBi |
#10 |
Incorrecto
|
0.071 s | 6 KBi |
#11 |
Correcto
|
0.063 s | 6 KBi |
#12 |
Correcto
|
0.051 s | 6 KBi |
const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let ordenado = true; rl.question('', (n) => { if (n > 0) { rl.question('', (data) => { const numbersString = data.toString(); 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(); });