CSES - Datatähti 2017 alku - Results
Submission details
Task:Pakkaus
Sender:Diapolo10
Submission time:2016-10-04 08:59:48 +0300
Language:Python3
Status:READY
Result:59
Feedback
groupverdictscore
#10
#20
#3ACCEPTED59
Test results
testverdicttimegroup
#1ACCEPTED0.06 s1details
#2ACCEPTED0.06 s1details
#3ACCEPTED0.06 s1details
#40.06 s1details
#50.06 s1details
#6ACCEPTED0.06 s2details
#7ACCEPTED0.06 s2details
#8ACCEPTED0.06 s2details
#90.06 s2details
#100.06 s2details
#11ACCEPTED0.17 s3details
#12ACCEPTED1.90 s3details
#13ACCEPTED0.07 s3details
#14ACCEPTED0.06 s3details
#15ACCEPTED0.06 s3details

Code

#! python3
# CSES 2017: Tehtävä 1

from itertools import groupby

def parser(string):
    """Split string between each and every integer"""
    return [''.join(g) for _, g in groupby(string, str.isalpha)]

def string_formation(int_str_list):
    """Form a string by multiplying each string by the preceeding number, then put the strings together"""
    finished_string = ""
    try: # Takes care of test cases that don't begin with a number
        int(int_str_list[0])
    except ValueError:
        finished_string += int_str_list[0]
    for i in int_str_list:
        if i.isdigit():
            finished_string += str(
                int_str_list[int_str_list.index(i)+1]*int(i)
            )
    return finished_string

def main():
    #while True:
        string_to_be_modified = input()
        parsed = parser(string_to_be_modified)
        print(string_formation(parsed))


if __name__ == "__main__":
    main()

Test details

Test 1

Group: 1

Verdict: ACCEPTED

input
1AAAAAAAAAAAAAAAAAAAA

correct output
AAAAAAAAAAAAAAAAAAAA

user output
AAAAAAAAAAAAAAAAAAAA

Test 2

Group: 1

Verdict: ACCEPTED

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAA

user output
AAAAAAAAAAAAAAAAAAAA

Test 3

Group: 1

Verdict: ACCEPTED

input
20A

correct output
AAAAAAAAAAAAAAAAAAAA

user output
AAAAAAAAAAAAAAAAAAAA

Test 4

Group: 1

Verdict:

input
2N1J2F1XH2D2B2VT1N1ES

correct output
NNJFFXHDDBBVTVTNES

user output
NNJNNJNNNNNNJJ

Test 5

Group: 1

Verdict:

input
2Z1E1UN1P2A2A1D2F2EZ1FZ1J

correct output
ZZEUNPAAAADFFEZEZFZJ

user output
ZZEEEZZZZEZZZZEE

Test 6

Group: 2

Verdict: ACCEPTED

input
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

Test 7

Group: 2

Verdict: ACCEPTED

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

Test 8

Group: 2

Verdict: ACCEPTED

input
1000A

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

Test 9

Group: 2

Verdict:

input
11QOUDQFAFUPAYCPXZ15KANCLRGT9S...

correct output
QOUDQFAFUPAYCPXZQOUDQFAFUPAYCP...

user output
QOUDQFAFUPAYCPXZQOUDQFAFUPAYCP...
Truncated

Test 10

Group: 2

Verdict:

input
20NFBIUXOSO10XRXZRMULZDUFK14BB...

correct output
NFBIUXOSONFBIUXOSONFBIUXOSONFB...

user output
NFBIUXOSONFBIUXOSONFBIUXOSONFB...
Truncated

Test 11

Group: 3

Verdict: ACCEPTED

input
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

Test 12

Group: 3

Verdict: ACCEPTED

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

Test 13

Group: 3

Verdict: ACCEPTED

input
1000000A

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

Test 14

Group: 3

Verdict: ACCEPTED

input
87GEIGDBZCYGSFYYCGQUAWQJFUUAQG...

correct output
GEIGDBZCYGSFYYCGQUAWQJFUUAQGDT...

user output
GEIGDBZCYGSFYYCGQUAWQJFUUAQGDT...
Truncated

Test 15

Group: 3

Verdict: ACCEPTED

input
316XXYCLTBFQRAXHQPTLDB275NMQJD...

correct output
XXYCLTBFQRAXHQPTLDBXXYCLTBFQRA...

user output
XXYCLTBFQRAXHQPTLDBXXYCLTBFQRA...
Truncated