CSES - Datatähti 2018 alku - Results
Submission details
Task:Merkkijono
Sender:Kurns
Submission time:2017-10-02 18:26:32 +0300
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.09 sdetails
#20.07 sdetails
#30.13 sdetails
#40.07 sdetails
#50.09 sdetails
#60.07 sdetails
#70.07 sdetails
#80.09 sdetails
#90.11 sdetails
#100.08 sdetails

Code

userInput = input()
allList = []
listString = ""
editing = True

for z in range(0, len(userInput)):
    allList.append(userInput[z])

while editing:
    
    if len(allList) < 2:
        editing = False
        break

    start = 0
    end = 0
    x = -1

    while x < len(allList):
        x += 1
        #print(x)
        #print(len(allList))
        if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
            start = x
            end = x+1
            if len(allList) > end:
                n = end + 1
                while allList[n] == allList[start]: #N aloittaa looppaamisen end+1, vie endin paikalleen
                    end += 1
                    n += 1
            for x in range(0, end-start+1):
                del allList[start]
        else:
            editing = False
                     
for k in range(0, len(allList)):
    listString += allList[k]
        
print(listString)

Test details

Test 1

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
ABABABABABABABABABABABABABABAB...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 23, in <module>
    if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
IndexError: list index out of range

Test 2

Verdict:

input
AABBAABBAABBAABBAABBAABBAABBAA...

correct output
(empty)

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 28, in <module>
    while allList[n] == allList[start]: #N aloittaa looppaamisen end+1, vie endin paikalleen
IndexError: list index out of range

Test 3

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
(empty)

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 23, in <module>
    if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
IndexError: list index out of range

Test 4

Verdict:

input
BBABABBBBBAABBBABABABBBBAAABAB...

correct output
BAB

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 23, in <module>
    if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
IndexError: list index out of range

Test 5

Verdict:

input
ACDCBBACDBBBACAACBBDBADBAABABA...

correct output
ACDCACDADBADABACACDCADADABABCA...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 28, in <module>
    while allList[n] == allList[start]: #N aloittaa looppaamisen end+1, vie endin paikalleen
IndexError: list index out of range

Test 6

Verdict:

input
EETFHIJOGACDHMGVFJCMETMZDEITTR...

correct output
TFHIJOGACDHMGVFJCMETMZDEIROTET...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 23, in <module>
    if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
IndexError: list index out of range

Test 7

Verdict:

input
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB...

correct output
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 23, in <module>
    if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
IndexError: list index out of range

Test 8

Verdict:

input
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS...

correct output
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 23, in <module>
    if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
IndexError: list index out of range

Test 9

Verdict:

input
QUVVTPXAMWWODFXRONJODPGBTCISGM...

correct output
QUTPXAMODFXRONJODPGBTCISGMVRBW...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 23, in <module>
    if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
IndexError: list index out of range

Test 10

Verdict:

input
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

correct output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 23, in <module>
    if allList[x] == allList[x+1]: #Jos kirjain on sama kuin seuraava kirjain
IndexError: list index out of range