Task: | Sanalista |
Sender: | xnor |
Submission time: | 2020-09-28 14:53:55 +0300 |
Language: | Rust |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | ACCEPTED | 0.01 s | details |
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 |