CSES - Datatähti 2018 alku - Results
Submission details
Task:Merkkijono
Sender:soap
Submission time:2017-10-02 01:13:09 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1--details
#2ACCEPTED0.03 sdetails
#30.05 sdetails
#40.04 sdetails
#50.04 sdetails
#60.03 sdetails
#70.04 sdetails
#80.05 sdetails
#90.04 sdetails
#100.05 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:7:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     REP(i, 0, inp.length()) 
                          ^
input/code.cpp:2:41: note: in definition of macro 'REP'
 #define REP(i,a,b) for (int i = a; i <= b; i++)
                                         ^

Code

#include <bits/stdc++.h>
#define REP(i,a,b) for (int i = a; i <= b; i++)
using namespace std;
int main() {
    string inp;
    cin >> inp;
    REP(i, 0, inp.length()) 
    {
	//cout << inp[i] << ", " << i << "\n";
	if(inp[i] == inp[i+1])
	{
            int x = i+2;
            while(x > 0)
            {
                if(inp[i] == inp[x]) x++;
             
                else 
		{
                    inp.erase(i, x);
                    x = -1;
                }
            }
	//cout << "reset \n";
        i = -1;
	}
    }
    cout << inp;
     
}

Test details

Test 1

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
ABABABABABABABABABABABABABABAB...

user output
(empty)

Test 2

Verdict: ACCEPTED

input
AABBAABBAABBAABBAABBAABBAABBAA...

correct output
(empty)

user output
(empty)

Test 3

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
(empty)

user output
ABABABABABABABABABABABABABABAB...

Test 4

Verdict:

input
BBABABBBBBAABBBABABABBBBAAABAB...

correct output
BAB

user output
ABABABABABA

Test 5

Verdict:

input
ACDCBBACDBBBACAACBBDBADBAABABA...

correct output
ACDCACDADBADABACACDCADADABABCA...

user output
ACDBADBDBCACBCBCBCACACDBDACBAD...

Test 6

Verdict:

input
EETFHIJOGACDHMGVFJCMETMZDEITTR...

correct output
TFHIJOGACDHMGVFJCMETMZDEIROTET...

user output
TFHIJOGACDHMGVFJCMETMZDEIKWXMH...

Test 7

Verdict:

input
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB...

correct output
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE...

user output
GLAHLYPRFCZKIKSJWABLZCYPQVKJOZ...

Test 8

Verdict:

input
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS...

correct output
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK...

user output
PISHWMOTCDAOKCVWVNOFCVIDUKPNVK...

Test 9

Verdict:

input
QUVVTPXAMWWODFXRONJODPGBTCISGM...

correct output
QUTPXAMODFXRONJODPGBTCISGMVRBW...

user output
QUXAMONJODPGBTCISGMVFNTZPSAWUD...

Test 10

Verdict:

input
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

correct output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

user output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...