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

Compiler report

input/code.cpp: In function 'int main(int, char**)':
input/code.cpp:26:23: warning: array subscript has type 'char' [-Wchar-subscripts]
             alphabet[c]++;
                       ^

Code

#include <iostream>
#include <string.h>

using namespace std;



int main(int argv, char *argc[]){
    int n;
    cin >> n;

    int result = 0;

    char alphabet[26];

    char word[31];

    for(; n > 0; n--){
        memset(alphabet, 0, 26);
        cin >> word;
        
        char c;
        char *off = word;
        for(c = *off; c; c = *++off){
            c-='a';
            alphabet[c]++;
        }

        for(int i = 0; i < 26; i++){
            if(alphabet[i] & 0x01) goto skip_add;
        }

        result++;

        skip_add:
        continue;
    }

    cout << result;

    return EXIT_SUCCESS;
}

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