Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.08 s | 7 KBi |
#2 |
Correcto
|
0.041 s | 7 KBi |
#3 |
Correcto
|
0.06 s | 19 KBi |
#4 |
Correcto
|
0.055 s | 7 KBi |
#5 |
Correcto
|
0.058 s | 7 KBi |
#6 |
Correcto
|
0.048 s | 7 KBi |
#7 |
Correcto
|
0.05 s | 7 KBi |
#8 |
Correcto
|
0.06 s | 20 KBi |
#9 |
Correcto
|
0.039 s | 7 KBi |
#10 |
Correcto
|
0.061 s | 7 KBi |
#11 |
Incorrecto
|
0.074 s | 8 KBi |
#12 |
Incorrecto
|
0.061 s | 7 KBi |
let readline = require("readline"); let lineNumber = 0; let listLengthInput; let listVerify = []; process.stdin.setEncoding("utf8"); let stdin = readline.createInterface({ input: process.stdin, terminal: false, }); stdin.on("line", readLine); function readLine(line) { if (lineNumber == 0) { if (!isNaN(parseInt(line))) { listLengthInput = parseInt(line); lineNumber++; } else { console.log("Invalid Input"); } } else { let numbersList = line.split(" "); if (listLengthInput === numbersList.length) { for (let index = 0; index < listLengthInput - 1; index++) { let num = numbersList[index]; let numi = numbersList[index + 1]; listVerify.push(num > numi); } if (listVerify.some((bool) => bool === true)) { console.log("Desordenado"); } else { console.log("Ordenado"); } } } }