CSES - Datatähti 2018 alku - Results
Submission details
Task:Merkkijono
Sender:Kameli
Submission time:2017-10-05 20:00:57 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#2ACCEPTED0.06 sdetails
#30.05 sdetails
#40.05 sdetails
#50.05 sdetails
#60.05 sdetails
#70.04 sdetails
#80.05 sdetails
#90.04 sdetails
#100.04 sdetails

Code

#include <iostream>
#include <string>
using namespace std;
int main(int argc,char *argv[]){
    string arg;
    cin>>arg;
    bool changed=true;
    while(changed){
        changed=false;
        int len=arg.length();
        for(int i=0;i<len-1;i++){
            if(arg[i]==arg[i+1]){
                char character=arg[i];
                int j=i;
                for(;;j++){
                    if(character!=arg[j]){
                        break;
                    }
                }
                arg.erase(i,j);
                changed=true;
                break;
            }
        }
    }
    cout<<arg+"\n";
    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
ABABABABABABABABABABABABABABAB...

correct output
ABABABABABABABABABABABABABABAB...

user output
ABABABABABABABABABABABABABABAB...

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...