Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.076 s | 7 KBi |
#2 |
Incorrecto
|
0.035 s | 7 KBi |
#3 |
Incorrecto
|
0.063 s | 7 KBi |
#4 |
Incorrecto
|
0.052 s | 7 KBi |
#5 |
Incorrecto
|
0.086 s | 7 KBi |
#6 |
Incorrecto
|
0.038 s | 7 KBi |
#7 |
Incorrecto
|
0.056 s | 7 KBi |
#8 |
Incorrecto
|
0.052 s | 7 KBi |
#9 |
Incorrecto
|
0.037 s | 7 KBi |
#10 |
Incorrecto
|
0.033 s | 7 KBi |
#11 |
Incorrecto
|
0.034 s | 7 KBi |
#12 |
Incorrecto
|
0.063 s | 7 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);