Task: | Sanalista |
Sender: | motsgar |
Submission time: | 2020-09-30 12:46:17 +0300 |
Language: | Node.js |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
test | verdict | time | |
---|---|---|---|
#1 | RUNTIME ERROR | 0.45 s | details |
#2 | RUNTIME ERROR | 0.45 s | details |
#3 | RUNTIME ERROR | 0.45 s | details |
Code
const readline = require('readline'); const input = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: false }); let output = 0; let inputAmount = 0; let inputtedValues = 0; let firstLine = true; input.on('line', function (line) { if (firstLine) { inputAmount = parseInt(line); firstLine = false; } else { let characters = {}; for (let i = 0; i < line.length; i++) { if (characters[line.charAt(i)] != undefined) { characters[line.charAt(i)]++; } else characters[line.charAt(i)] = 1; } let hasEven = true; Object.values(characters).forEach(val => { if (val % 2 != 0) hasEven = false; }); if (hasEven) output++; inputtedValues++; if (inputtedValues == inputAmount) { console.log(output); process.exit(1); } } });
Test details
Test 1
Verdict: RUNTIME ERROR
input |
---|
1000 korvata sopimusaika nuhatartunta korttiautomaatti ... |
correct output |
---|
15 |
user output |
---|
15 |
Test 2
Verdict: RUNTIME ERROR
input |
---|
1000 pub hansikaslokero erikoisvalmisteinen unijukka ... |
correct output |
---|
42 |
user output |
---|
42 |
Test 3
Verdict: RUNTIME ERROR
input |
---|
1000 haapalastu toipumisaika mustalaiskieli taidelainaamo ... |
correct output |
---|
70 |
user output |
---|
70 |