Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.06 s | 7 KBi |
#2 |
Incorrecto
|
0.066 s | 8 KBi |
#3 |
Incorrecto
|
0.066 s | 9 KBi |
#4 |
Incorrecto
|
0.074 s | 18 KBi |
#5 |
Correcto
|
0.054 s | 7 KBi |
#6 |
Incorrecto
|
0.082 s | 17 KBi |
#7 |
Incorrecto
|
0.083 s | 8 KBi |
#8 |
Correcto
|
0.082 s | 28 KBi |
#9 |
Incorrecto
|
0.067 s | 8 KBi |
#10 |
Correcto
|
0.074 s | 8 KBi |
let readline = require("readline"); let lineNumber = 0; let listLengthInput; let listNumber; let listLenghtQuery; let listQuery = []; let listVerify = []; process.stdin.setEncoding("utf8"); let stdin = readline.createInterface({ input: process.stdin, terminal: false, }); stdin.on("line", readLine); function readLine(line) { if (lineNumber == 0) { listLengthInput = parseInt(line); lineNumber++; } else if (lineNumber == 1) { listNumber = line.toString().split(/\s+/); lineNumber++; } else if (lineNumber == 2) { listLenghtQuery = parseInt(line); listVerify = new Array(listLenghtQuery).fill(0); lineNumber++; } else if (lineNumber > 2) { listQuery.push(parseInt(line)); lineNumber++; if (lineNumber === listLenghtQuery + 3) { for (let index = 0; index < listLengthInput; index++) { let num = listNumber[index]; for (let query of listQuery) { queryIndex = listQuery.indexOf(query); if (num > query) { listVerify[queryIndex] = listVerify[queryIndex] + 1; } } } listVerify.map((count) => console.log(count)); } } }