| Task: | Pakkaus |
| Sender: | Diapolo10 |
| Submission time: | 2016-10-04 08:57:20 +0300 |
| Language: | Python3 |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | RUNTIME ERROR | 0 |
| #2 | RUNTIME ERROR | 0 |
| #3 | RUNTIME ERROR | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | RUNTIME ERROR | 0.06 s | 1 | details |
| #2 | RUNTIME ERROR | 0.08 s | 1 | details |
| #3 | RUNTIME ERROR | 0.06 s | 1 | details |
| #4 | RUNTIME ERROR | 0.06 s | 1 | details |
| #5 | RUNTIME ERROR | 0.06 s | 1 | details |
| #6 | RUNTIME ERROR | 0.06 s | 2 | details |
| #7 | RUNTIME ERROR | 0.06 s | 2 | details |
| #8 | RUNTIME ERROR | 0.10 s | 2 | details |
| #9 | RUNTIME ERROR | 0.06 s | 2 | details |
| #10 | RUNTIME ERROR | 0.07 s | 2 | details |
| #11 | RUNTIME ERROR | 0.19 s | 3 | details |
| #12 | RUNTIME ERROR | 1.83 s | 3 | details |
| #13 | RUNTIME ERROR | 0.07 s | 3 | details |
| #14 | RUNTIME ERROR | 0.08 s | 3 | details |
| #15 | RUNTIME ERROR | 0.07 s | 3 | details |
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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| 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: RUNTIME ERROR
| input |
|---|
| 316XXYCLTBFQRAXHQPTLDB275NMQJD... |
| correct output |
|---|
| XXYCLTBFQRAXHQPTLDBXXYCLTBFQRA... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 34, in <module>
main()...