Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.057 s | 11 KBi |
#2 |
Incorrecto
|
0.052 s | 7 KBi |
#3 |
Incorrecto
|
0.058 s | 6 KBi |
#4 |
Incorrecto
|
0.16 s | 34 KBi |
#5 |
Incorrecto
|
0.069 s | 6 KBi |
#6 |
Incorrecto
|
0.054 s | 7 KBi |
#7 |
Incorrecto
|
0.078 s | 6 KBi |
#8 |
Incorrecto
|
0.044 s | 6 KBi |
#9 |
Incorrecto
|
0.06 s | 7 KBi |
#10 |
Incorrecto
|
0.065 s | 6 KBi |
#11 |
Incorrecto
|
0.053 s | 7 KBi |
#12 |
Incorrecto
|
0.062 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 sorted = true for (let i = 1; i < arr.length; i++) { if (arr[i] < arr[i - 1]) { sorted = false; break; } } return sorted } rl.on("line", function(line, lineNum = lineCounter()) { if (lineNum === 2) { var parts = line.split(" ").map(Number); console.log(isSorted(parts) ? "Ordenado" : "Desordenado") } });