Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.048 s | 6 KBi |
#2 |
Correcto
|
0.047 s | 6 KBi |
#3 |
Correcto
|
0.055 s | 9 KBi |
#4 |
Correcto
|
0.068 s | 16 KBi |
#5 |
Correcto
|
0.068 s | 7 KBi |
#6 |
Correcto
|
0.054 s | 6 KBi |
#7 |
Correcto
|
0.056 s | 9 KBi |
#8 |
Correcto
|
0.05 s | 6 KBi |
#9 |
Correcto
|
0.058 s | 6 KBi |
#10 |
Correcto
|
0.065 s | 12 KBi |
#11 |
Correcto
|
0.056 s | 6 KBi |
#12 |
Correcto
|
0.055 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) => { const numbers = numbersString.split(' ').map(number => Number(number)); for(let i = 0; i < n - 1; i++) { if (numbers[i] > numbers[i+1]) { ordenado = false; break; } } console.log(ordenado ? 'Ordenado' : 'Desordenado'); rl.close(); }); });