Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.045 s | 6 KBi |
#2 |
Incorrecto
|
0.053 s | 6 KBi |
#3 |
Incorrecto
|
0.05 s | 6 KBi |
#4 |
Incorrecto
|
0.052 s | 6 KBi |
#5 |
Incorrecto
|
0.051 s | 7 KBi |
#6 |
Correcto
|
0.047 s | 6 KBi |
#7 |
Correcto
|
0.054 s | 6 KBi |
#8 |
Correcto
|
0.065 s | 6 KBi |
#9 |
Incorrecto
|
0.053 s | 6 KBi |
#10 |
Incorrecto
|
0.047 s | 6 KBi |
#11 |
Correcto
|
0.046 s | 6 KBi |
#12 |
Correcto
|
0.052 s | 6 KBi |
const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let ordenado = true; rl.question('', () => { 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(); }); });