| Task: | Sanalista |
| Sender: | jaaskelainen |
| Submission time: | 2020-09-28 10:58:09 +0300 |
| Language: | Python3 (CPython3) |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 100 |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.03 s | details |
| #2 | ACCEPTED | 0.03 s | details |
| #3 | ACCEPTED | 0.03 s | details |
Code
#!/usr/bin/python
# Datatähti 2021 tehtävä "Sanalista"
# A little messy but it works
# Luka Jääskeläinen 2020
inp = input()
wordlist = []
equalChars = 0
# Get the words
for c in range(int(inp)):
wordlist.append(input())
# Analyse the words
for word in wordlist:
letters = {}
dupLetters = {}
# Get list of letters and amount of them
for c in word:
if c not in letters:
letters[c] = 0
letters[c] += 1
# Check for all the letters that are divisible by 2
for l in letters:
if(letters[l] % 2 == 0):
dupLetters[l] = letters[l]
# Count all the words with equal letters
if(letters == dupLetters):
equalChars += 1
# Print the result :-)
print(equalChars)
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 |
