Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.041 s | 7 KBi |
#2 |
Incorrecto
|
0.04 s | 7 KBi |
#3 |
Incorrecto
|
0.036 s | 7 KBi |
#4 |
Incorrecto
|
0.043 s | 6 KBi |
#5 |
Incorrecto
|
0.038 s | 7 KBi |
#6 |
Incorrecto
|
0.037 s | 7 KBi |
#7 |
Incorrecto
|
0.039 s | 7 KBi |
#8 |
Incorrecto
|
0.038 s | 7 KBi |
#9 |
Incorrecto
|
0.044 s | 7 KBi |
#10 |
Incorrecto
|
0.04 s | 7 KBi |
#11 |
Incorrecto
|
0.046 s | 6 KBi |
#12 |
Incorrecto
|
0.041 s | 7 KBi |
const rl = require('readline').createInterface({ input: process.stdin, output: process.stdout }) const line1 = () => { return new Promise((resolve) => { rl.question('', (answer) => { resolve(answer) }) }) } const line2 = () => { return new Promise((resolve) => { rl.question('', (answer) => { resolve(answer.split(" ")) }) }) } const main = async () => { elements = await line1() array = await line2() rl.close() sorted = true for (var i = 0; i < elements; i++) { if(array[i] >= array[i + 1]) { sorted = false break } } if(sorted) { console.log('Ordenado') }else{ console.log('Desordenado') } }