CSES - Datatähti 2021 alku - Results
Submission details
Task:Sanalista
Sender:Luukasa
Submission time:2020-09-28 00:36:02 +0300
Language:C++ (C++17)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.01 sdetails
#20.01 sdetails
#30.01 sdetails

Code

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

int main()
{
	int n; cin >> n;
	int ans = n;
	vector<string> sanat;
	string temp = "";
	for(int i = 0; i < n; i++)
	{
		cin >> temp;
		sort(temp.begin(), temp.end()); // maybe sort each word and then check for letter amounts
		sanat.push_back(temp);
	}
	for(int i = 0; i < n; i++)
	{
		char prev = ' ';
		for(char c : sanat[i])
		{
			if(prev == ' ')
			{
				prev = c;
				continue;
			}
			if(c==prev)
			{
				prev = ' ';
				continue;
			}
			else
			{
				ans--;
				break;
			}
		}
	}
	cout << ans;
	return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
1000
korvata
sopimusaika
nuhatartunta
korttiautomaatti
...

correct output
15

user output
15

Test 2

Verdict:

input
1000
pub
hansikaslokero
erikoisvalmisteinen
unijukka
...

correct output
42

user output
45

Test 3

Verdict:

input
1000
haapalastu
toipumisaika
mustalaiskieli
taidelainaamo
...

correct output
70

user output
72