CSES - Datatähti 2021 alku - Results
Submission details
Task:Sanalista
Sender:T
Submission time:2020-09-28 00:33:12 +0300
Language:C++ (C++11)
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()':
input/code.cpp:42:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i = 0; i < word.length(); i++) {
                         ~~^~~~~~~~~~~~~~~

Code

/**
 * Datatähti 2021 alku
 * Sanalista/Word list
 * @author TRS
 */
//Include
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <list>
#include <queue>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <regex>
//Definitions
using namespace std;
using ll = long long;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
#define pb push_back
#define mp make_pair
#define mt make_tuple
//Constants
#define infinity 0x3f3f3f3f
#define linfinity 0x3f3f3f3f3f3f3f3f
#define MOD 1000000007
int n;
int answer = 0;
string word;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    for (int w = 0; w < n; w++) {
        cin>>word;
        bool valid = true;
        int letters[26] = {0};
        for (int i = 0; i < word.length(); i++) {
            char character = word.at(i);
            letters[character - 'a'] += 1;
        }
        for (int i = 0; i < 26; i++) {
            if (letters[i] % 2 == 1) {
                valid = false;
                break;
            }
        }
        if (valid) {
            answer++;
        }
    }
    cout<<answer<<"\n";
    return 0;
}

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