Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.058 s | 7 KBi |
#2 |
Correcto
|
0.057 s | 7 KBi |
#3 |
Correcto
|
0.052 s | 7 KBi |
#4 |
Correcto
|
0.071 s | 7 KBi |
#5 |
Correcto
|
0.062 s | 7 KBi |
#6 |
Correcto
|
0.055 s | 7 KBi |
#7 |
Correcto
|
0.064 s | 7 KBi |
#8 |
Correcto
|
0.061 s | 7 KBi |
#9 |
Correcto
|
0.061 s | 8 KBi |
#10 |
Correcto
|
0.069 s | 8 KBi |
const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }) function countElementsGreaterThan(arr, input) { return arr.filter(el => Number(el) > Number(input)).length } let lineNumber = 0; let arr = []; let results = []; rl.on("line", line => { ++lineNumber; if (lineNumber === 2) { arr = [...line.split(' ')] } if (lineNumber > 3) { console.log( countElementsGreaterThan(arr,line) ); } })