Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.065 s | 7 KBi |
#2 |
Correcto
|
0.054 s | 7 KBi |
#3 |
Incorrecto
|
0.055 s | 7 KBi |
#4 |
Correcto
|
0.042 s | 7 KBi |
#5 |
Correcto
|
0.035 s | 7 KBi |
#6 |
Correcto
|
0.037 s | 7 KBi |
#7 |
Correcto
|
0.048 s | 7 KBi |
#8 |
Incorrecto
|
0.054 s | 7 KBi |
#9 |
Incorrecto
|
0.04 s | 7 KBi |
#10 |
Incorrecto
|
0.038 s | 7 KBi |
#11 |
Incorrecto
|
0.039 s | 7 KBi |
#12 |
Incorrecto
|
0.036 s | 7 KBi |
#13 |
Incorrecto
|
0.035 s | 7 KBi |
#14 |
Correcto
|
0.049 s | 7 KBi |
#15 |
Incorrecto
|
0.053 s | 7 KBi |
#16 |
Incorrecto
|
0.039 s | 7 KBi |
#17 |
Incorrecto
|
0.039 s | 7 KBi |
#18 |
Incorrecto
|
0.059 s | 7 KBi |
#19 |
Incorrecto
|
0.037 s | 7 KBi |
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(largestNumber); } } }