CSES - Datatähti 2018 alku - Results
Submission details
Task:Merkkijono
Sender:_Serinaz_
Submission time:2017-10-11 13:49:52 +0300
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.07 sdetails
#20.09 sdetails
#30.07 sdetails
#40.07 sdetails
#50.08 sdetails
#60.08 sdetails
#70.07 sdetails
#80.07 sdetails
#90.09 sdetails
#100.08 sdetails

Code

#merkkijono



def merkkijono(string):
	lista = list(string)
	k=0
	for i in range(len(lista)-2):
		if k>=len(lista)-2:
			break
		if lista[k] == lista[k+1]:
			j=k+1
			viimeinen = 0
			while lista[k]==lista[j]:
				viimeinen = j
				
				j += 1
				if j==len(lista):
					break
			viimeinen += 1				
			lista[k:viimeinen] = []
			
		else:
			k+=1
			
		print(k)
	
	print("".join(str(x) for x in lista))


jono = input()
merkkijono(jono)

Test details

Test 1

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
ABABABABABABABABABABABABABABAB...

user output
1
2
3
4
5
...

Test 2

Verdict:

input
AABBAABBAABBAABBAABBAABBAABBAA...

correct output
(empty)

user output
0
0
0
0
0
...

Test 3

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
(empty)

user output
1
2
3
4
5
...

Test 4

Verdict:

input
BBABABBBBBAABBBABABABBBBAAABAB...

correct output
BAB

user output
0
1
2
3
3
...

Test 5

Verdict:

input
ACDCBBACDBBBACAACBBDBADBAABABA...

correct output
ACDCACDADBADABACACDCADADABABCA...

user output
1
2
3
4
4
...

Test 6

Verdict:

input
EETFHIJOGACDHMGVFJCMETMZDEITTR...

correct output
TFHIJOGACDHMGVFJCMETMZDEIROTET...

user output
0
1
2
3
4
...

Test 7

Verdict:

input
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB...

correct output
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE...

user output
1
1
2
3
4
...

Test 8

Verdict:

input
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS...

correct output
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK...

user output
1
2
3
4
5
...

Test 9

Verdict:

input
QUVVTPXAMWWODFXRONJODPGBTCISGM...

correct output
QUTPXAMODFXRONJODPGBTCISGMVRBW...

user output
1
2
2
3
4
...

Test 10

Verdict:

input
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

correct output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

user output
1
2
3
4
5
...