Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.06 s | 6 KBi |
#2 |
Correcto
|
0.055 s | 7 KBi |
#3 |
Correcto
|
0.049 s | 6 KBi |
#4 |
Correcto
|
0.058 s | 6 KBi |
#5 |
Correcto
|
0.052 s | 6 KBi |
#6 |
Correcto
|
0.054 s | 6 KBi |
#7 |
Correcto
|
0.063 s | 6 KBi |
#8 |
Correcto
|
0.052 s | 7 KBi |
#9 |
Correcto
|
0.049 s | 6 KBi |
#10 |
Correcto
|
0.049 s | 7 KBi |
#11 |
Correcto
|
0.06 s | 6 KBi |
#12 |
Correcto
|
0.039 s | 7 KBi |
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); function getNumbers(n) { rl.once("line", function (line) { const parts = line.split(" ").slice(0, n); const inAscOrder = (arr) => arr.join("") === arr.sort((a, b) => a - b).join(""); const estado = inAscOrder(parts) ? "Ordenado" : "Desordenado"; console.log(estado); rl.close(); }); } rl.once("line", (line) => { const numberOfEntries = line.split(" ").slice(0, 1)[0]; const numberOfEntriesInt = parseInt(numberOfEntries, 10); getNumbers(numberOfEntries) });