Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.036 s | 7 KBi |
#2 |
Incorrecto
|
0.03 s | 7 KBi |
#3 |
Incorrecto
|
0.033 s | 7 KBi |
#4 |
Incorrecto
|
0.079 s | 7 KBi |
#5 |
Incorrecto
|
0.035 s | 7 KBi |
#6 |
Incorrecto
|
0.035 s | 7 KBi |
#7 |
Incorrecto
|
0.067 s | 7 KBi |
#8 |
Incorrecto
|
0.083 s | 33 KBi |
#9 |
Incorrecto
|
0.062 s | 7 KBi |
#10 |
Incorrecto
|
0.063 s | 7 KBi |
#11 |
Incorrecto
|
0.085 s | 31 KBi |
#12 |
Incorrecto
|
0.099 s | 33 KBi |
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const EventEmitter = require("events"); const emitter = new EventEmitter(); 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); emitter.emit("getNumbers", numberOfEntriesInt); }); emitter.on("getNumbers", getNumbers);