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

Envío 6836

Problema 0x4f - Rectángulo de máxima área dentro de un histograma pequeño

  • Autor: pablopvsky
  • Fecha: 2022-12-29 03:47:02 UTC (Hace alrededor de 1 mes)
Caso # Resultado Tiempo Memoria
#1
Incorrecto
0.058 s 7 KBi
#2
Incorrecto
0.038 s 7 KBi
#3
Incorrecto
0.036 s 7 KBi
#4
Correcto
0.04 s 7 KBi
#5
Correcto
0.039 s 7 KBi
#6
Correcto
0.036 s 7 KBi
#7
Correcto
0.045 s 7 KBi
#8
Incorrecto
0.048 s 7 KBi
#9
Incorrecto
0.034 s 7 KBi
#10
Incorrecto
0.044 s 7 KBi
#11
Incorrecto
0.039 s 7 KBi
#12
Incorrecto
0.038 s 7 KBi
#13
Incorrecto
0.051 s 7 KBi
#14
Correcto
0.043 s 7 KBi
#15
Incorrecto
0.051 s 7 KBi
#16
Incorrecto
0.039 s 7 KBi
#17
Incorrecto
0.056 s 7 KBi
#18
Incorrecto
0.04 s 7 KBi
#19
Incorrecto
0.039 s 7 KBi
Puntos totales: 27 / 100

Código

let readline = require("readline");

process.stdin.setEncoding("utf8");
let stdin = readline.createInterface({
  input: process.stdin,
  terminal: false,
});

stdin.on("line", readLine);

let lineNumber = 0;
let buildsNumber = 0;
let buildsList;
let totalArea;
let largestArea;
let currentBuilds = [];
let step = 0;

function readLine(line) {
  if (lineNumber == 0) {
    buildsNumber = parseInt(line);
    lineNumber++;
  } else {
    buildsList = line.split(" ").map((number) => parseInt(number));
    largestNumber = Math.max(...buildsList);
    smallestNumber = Math.min(...buildsList);
    totalArea = buildsNumber * largestNumber;

    let allEqual = buildsList.every((build) => build === buildsList[0]);

    if(allEqual) {
      console.log(totalArea);
    } else {

      
      console.log("a");
    }
  }
}