CSES - Datatähti 2017 alku - Results
Submission details
Task:Pakkaus
Sender:Diapolo10
Submission time:2016-10-04 08:57:20 +0300
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.06 s1details
#20.08 s1details
#30.06 s1details
#40.06 s1details
#50.06 s1details
#60.06 s2details
#70.06 s2details
#80.10 s2details
#90.06 s2details
#100.07 s2details
#110.19 s3details
#121.83 s3details
#130.07 s3details
#140.08 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:

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAA

user output
AAAAAAAAAAAAAAAAAAAA

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

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

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

Test 5

Group: 1

Verdict:

input
2Z1E1UN1P2A2A1D2F2EZ1FZ1J

correct output
ZZEUNPAAAADFFEZEZFZJ

user output
ZZEEEZZZZEZZZZEE

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

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:

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

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

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

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

Test 10

Group: 2

Verdict:

input
20NFBIUXOSO10XRXZRMULZDUFK14BB...

correct output
NFBIUXOSONFBIUXOSONFBIUXOSONFB...

user output
NFBIUXOSONFBIUXOSONFBIUXOSONFB...
Truncated

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

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:

input
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Truncated

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

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()...