█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 5068

Problema 0x9d - ¿Está ordenado?

  • Autor: jarangolp
  • Fecha: 2021-10-10 00:57:27 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.051 s 6 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.048 s 6 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.064 s 6 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.063 s 6 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.042 s 6 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.064 s 6 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.041 s 8 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.043 s 6 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.051 s 6 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.04 s 6 KBi
#11
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.046 s 9 KBi
#12
Error en tiempo de ejecución (NZEC)
Exited with error status 1
/box/script.js:11
  let n;
      ^

SyntaxError: Identifier 'n' has already been declared
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
0.047 s 6 KBi
Puntos totales: 0 / 100

Código

const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
let ordenado = true;

rl.question('', (n) => {
  let n;
  if (n > 0) {
    rl.question('', (data) => {
      const numbersString = data.toString();
      const numbers = numbersString.split(' ');
      for(let i = 1; i < numbers.lenght; i++) {
        if (number[i-1] > number[i]) {
          ordenado = false;
          break;
        }
      }
    });
  }
  console.log(ordenado ? 'Ordenado' : 'Desordenado');
  rl.close();
});