CSES - Datatähti 2021 alku - Results
Submission details
Task:Sanalista
Sender:Kemil
Submission time:2020-10-01 12:09:10 +0300
Language: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()':
input/code.cpp:15:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int j = 0; j < Word.length(); j++)
                   ~~^~~~~~~~~~~~~~~
input/code.cpp:18:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int k = 0; k < Word.length(); k++)
                    ~~^~~~~~~~~~~~~~~

Code

#include <iostream>
using namespace std;
int main()
{
	int Length = 0;
	int Occurances = 0;
	int Score = 0;
	cin >> Length;
	string Word;
	
    
	for (int i = 0; i < Length; i++)
	{
		cin >> Word;
		for (int j = 0; j < Word.length(); j++)
		{
			Occurances = 0;
			for (int k = 0; k < Word.length(); k++)
			{
				if (Word[j] == Word[k])
				{
					Occurances++;
				}
			}
			if (Occurances % 2 != 0)
			{
				j = Word.length();
				
			}
		}
		if (Occurances % 2 == 0)
		{
			Score++;
		}
	}
	cout << Score;
}

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