CSES - Datatähti 2017 alku - Results
Submission details
Task:Pakkaus
Sender:Diapolo10
Submission time:2016-10-04 08:58:04 +0300
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.09 s1details
#2ACCEPTED0.07 s1details
#30.06 s1details
#40.06 s1details
#50.06 s1details
#60.07 s2details
#7ACCEPTED0.06 s2details
#80.07 s2details
#90.06 s2details
#100.06 s2details
#110.18 s3details
#12ACCEPTED1.89 s3details
#130.06 s3details
#140.07 s3details
#150.07 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]
    if int_str_list[-1].isdigit: # If the list ends with a number, remove it
        int_str_list = int_str_list[:-1]
    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:

input
1AAAAAAAAAAAAAAAAAAAA

correct output
AAAAAAAAAAAAAAAAAAAA

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 34, in <module>
    main()...

Test 2

Group: 1

Verdict: ACCEPTED

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAA

user output
AAAAAAAAAAAAAAAAAAAA

Test 3

Group: 1

Verdict:

input
20A

correct output
AAAAAAAAAAAAAAAAAAAA

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 34, in <module>
    main()...

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:

input
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 34, in <module>
    main()...

Test 7

Group: 2

Verdict: ACCEPTED

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

Test 8

Group: 2

Verdict:

input
1000A

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 34, in <module>
    main()...

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:

input
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 34, in <module>
    main()...

Test 12

Group: 3

Verdict: ACCEPTED

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

Test 13

Group: 3

Verdict:

input
1000000A

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 34, in <module>
    main()...

Test 14

Group: 3

Verdict:

input
87GEIGDBZCYGSFYYCGQUAWQJFUUAQG...

correct output
GEIGDBZCYGSFYYCGQUAWQJFUUAQGDT...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 34, in <module>
    main()...

Test 15

Group: 3

Verdict:

input
316XXYCLTBFQRAXHQPTLDB275NMQJD...

correct output
XXYCLTBFQRAXHQPTLDBXXYCLTBFQRA...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 34, in <module>
    main()...