CSES - Datatähti 2018 alku - Results
Submission details
Task:Merkkijono
Sender:Pakasteporkkana
Submission time:2017-10-03 23:03:38 +0300
Language:Python2
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.07 sdetails
#20.06 sdetails
#30.04 sdetails
#40.08 sdetails
#50.06 sdetails
#60.08 sdetails
#70.06 sdetails
#80.06 sdetails
#90.05 sdetails
#100.04 sdetails

Code

#input string
string = "AAAAAAABBBBBBBBBBBBBBBCCCCBCCCCDDDDBBBBBA"
list1 = list(string)
a = True
while(a):
    for i in xrange(len(list1)-1):
        b = False
        while(list1[i] == list1[i+1]):
            list1.pop(i+1)
            b = True
            if(len(list1) == 1):
                break
        if b:
            list1.pop(i)
            break
        if i == len(list1)-2:
            a = False
    if len(list1)-1 == 0:
        a = False
string = "".join(list1)
print(string)

Test details

Test 1

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
ABABABABABABABABABABABABABABAB...

user output
A

Test 2

Verdict:

input
AABBAABBAABBAABBAABBAABBAABBAA...

correct output
(empty)

user output
A

Test 3

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
(empty)

user output
A

Test 4

Verdict:

input
BBABABBBBBAABBBABABABBBBAAABAB...

correct output
BAB

user output
A

Test 5

Verdict:

input
ACDCBBACDBBBACAACBBDBADBAABABA...

correct output
ACDCACDADBADABACACDCADADABABCA...

user output
A

Test 6

Verdict:

input
EETFHIJOGACDHMGVFJCMETMZDEITTR...

correct output
TFHIJOGACDHMGVFJCMETMZDEIROTET...

user output
A

Test 7

Verdict:

input
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB...

correct output
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE...

user output
A

Test 8

Verdict:

input
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS...

correct output
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK...

user output
A

Test 9

Verdict:

input
QUVVTPXAMWWODFXRONJODPGBTCISGM...

correct output
QUTPXAMODFXRONJODPGBTCISGMVRBW...

user output
A

Test 10

Verdict:

input
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

correct output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

user output
A