CSES - Datatähti 2018 alku - Results
Submission details
Task:Merkkijono
Sender:Ilmari2000
Submission time:2017-10-13 19:25:00 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.04 sdetails
#20.07 sdetails
#30.05 sdetails
#40.06 sdetails
#50.06 sdetails
#60.06 sdetails
#70.05 sdetails
#80.06 sdetails
#90.07 sdetails
#100.05 sdetails

Code

#include <iostream>
#include <string>

using namespace std;

int main()
{
	string str;
	cin >> str;

	for(unsigned int i = 0; i < str.length(); i++)
		if(isalpha(str[i]))
		{
			str.erase(i, 1);
			i = 0;
		}

	for(unsigned int i = 0; i < str.length(); i++)
	{
		char current = str[i];

		unsigned int j = 0;
		for(j = 0; toupper(str[i + j]) == toupper(current); j++);
		if(j > 1)
		{
			str.erase(i, j);
			i = 0;
		}
	}

	for(unsigned int i = 0; i < str.length(); i++)
		cout << (char)toupper(str[i]);
	cout << endl;
}

Test details

Test 1

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
ABABABABABABABABABABABABABABAB...

user output
B

Test 2

Verdict:

input
AABBAABBAABBAABBAABBAABBAABBAA...

correct output
(empty)

user output
A

Test 3

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
(empty)

user output
B

Test 4

Verdict:

input
BBABABBBBBAABBBABABABBBBAAABAB...

correct output
BAB

user output
B

Test 5

Verdict:

input
ACDCBBACDBBBACAACBBDBADBAABABA...

correct output
ACDCACDADBADABACACDCADADABABCA...

user output
C

Test 6

Verdict:

input
EETFHIJOGACDHMGVFJCMETMZDEITTR...

correct output
TFHIJOGACDHMGVFJCMETMZDEIROTET...

user output
E

Test 7

Verdict:

input
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB...

correct output
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE...

user output
O

Test 8

Verdict:

input
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS...

correct output
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK...

user output
I

Test 9

Verdict:

input
QUVVTPXAMWWODFXRONJODPGBTCISGM...

correct output
QUTPXAMODFXRONJODPGBTCISGMVRBW...

user output
U

Test 10

Verdict:

input
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

correct output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

user output
O