Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.061 s | 7 KBi |
#2 |
Incorrecto
|
0.152 s | 32 KBi |
#3 |
Incorrecto
|
0.06 s | 7 KBi |
#4 |
Incorrecto
|
0.057 s | 7 KBi |
#5 |
Incorrecto
|
0.06 s | 6 KBi |
#6 |
Incorrecto
|
0.06 s | 6 KBi |
#7 |
Incorrecto
|
0.068 s | 6 KBi |
#8 |
Incorrecto
|
0.073 s | 6 KBi |
#9 |
Incorrecto
|
0.055 s | 7 KBi |
#10 |
Incorrecto
|
0.057 s | 7 KBi |
#11 |
Incorrecto
|
0.057 s | 7 KBi |
#12 |
Incorrecto
|
0.067 s | 6 KBi |
var readline = require('readline'); var rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); function lineCounter(line = 0) { return ++line } function isSorted(arr) { let previousItem = Number.POSITIVE_INFINITY return arr.some((item, index) => { const sorted = item > previousItem || item === previousItem previousItem = item return sorted }) } rl.on("line", function(line, lineNum = lineCounter()) { if (lineNum === 2) { var parts = line.split(" ").map(Number); console.log(isSorted(parts) ? "Ordenado" : "Desordenado") } });