CSES - Datatähti 2021 alku - Results
Submission details
Task:Sanalista
Sender:xnor
Submission time:2020-09-28 14:53:55 +0300
Language:Rust
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.01 sdetails
#2ACCEPTED0.01 sdetails
#3ACCEPTED0.01 sdetails

Code

use std::io::{self, BufRead};

fn main() {
    let mut lines = io::BufReader::new(io::stdin()).lines();

    let n = lines.next().unwrap().unwrap().parse().unwrap();
    let mut words = Vec::new();

    for _ in 0..n {
        words.push(lines.next().unwrap().unwrap())
    }

    let mut res = 0;

    for word in words {
        let mut chars = [0; 255];
        for b in word.bytes() {
            chars[b as usize] += 1;
        }
        if chars.iter().all(|c| *c % 2 == 0) {
            res += 1;
        }
    }

    println!("{}", res);
}

Test details

Test 1

Verdict: ACCEPTED

input
1000
korvata
sopimusaika
nuhatartunta
korttiautomaatti
...

correct output
15

user output
15

Test 2

Verdict: ACCEPTED

input
1000
pub
hansikaslokero
erikoisvalmisteinen
unijukka
...

correct output
42

user output
42

Test 3

Verdict: ACCEPTED

input
1000
haapalastu
toipumisaika
mustalaiskieli
taidelainaamo
...

correct output
70

user output
70