Submission details
Task:Tulkki
Sender:adex720
Submission time:2025-10-31 21:52:57 +0200
Language:Python3 (CPython3)
Status:READY
Result:0
Feedback
subtaskverdictscore
#10
#20
#30
Test results
testverdicttimesubtask
#10.02 s1, 2, 3details
#20.02 s1, 2, 3details
#30.02 s1, 2, 3details
#40.02 s1, 2, 3details
#50.02 s1, 2, 3details
#60.02 s1, 2, 3details
#70.02 s2, 3details
#80.02 s2, 3details
#90.02 s2, 3details
#100.02 s2, 3details
#110.02 s2, 3details
#120.02 s2, 3details
#130.02 s3details
#140.02 s3details
#150.02 s3details
#160.02 s3details
#170.02 s3details
#180.02 s3details

Code

import sys

komennot = []

for x in sys.stdin:
    for y in x.split(None):
        ind = y.find('#')
        if ind == -1:
            komennot.append(y)
        elif ind > 0:
            komennot.append(y.split('#')[0])

arvot=[0]*27
koodi = ""
sisennys = 0

komennot.append('X')

i = -1
n = len(komennot) - 2
while i < n:
    i+=1
    if komennot[i] == '(':
        sisennys+=1
        continue
    if komennot[i] == ')':
        sisennys-=1
        continue
    
    koodi += '\n' + '    ' * sisennys
    index = ord(komennot[i+1][0]) - ord('A')
    
    if komennot[i][0] == 'C':
        koodi += f'exec("arvot[{index}]=0")'
    elif komennot[i][0] == 'I':
        koodi += f'exec("arvot[{index}]+=1")'
    elif komennot[i][0] == 'P':
        koodi += f'print(arvot[{index}])'
    elif komennot[i][0] == 'R':
        koodi += f'for j{i} in range(arvot[{index}]):'
        
print(koodi)
eval(koodi)

Test details

Test 1 (public)

Subtask: 1, 2, 3

Verdict:

input
PRINT X
INCREASE X
PRINT X
INCREASE X
PRINT X
...

correct output
0 1 2 0 

user output

print(arvot[23])

exec("arvot[23]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[23]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 2 (public)

Subtask: 1, 2, 3

Verdict:

input
INCREASE
X
# aybabtu
   PRINT    X
INCREASE # test
...

correct output
1 3 

user output

exec("arvot[23]+=1")


print(arvot[23])
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 5
    print(arvot[23])
    ^^^^^
SyntaxError: invalid syntax

Test 3 (public)

Subtask: 1, 2, 3

Verdict:

input
# Create number 3
INCREASE X
INCREASE X
INCREASE X

...

correct output

user output

exec("arvot[45]=0")


exec("arvot[23]+=1")
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 5
    exec("arvot[23]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 4 (public)

Subtask: 1, 2, 3

Verdict:

input
INCREASE A
PRINT A
INCREASE B
PRINT B
INCREASE C
...

correct output
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

user output

exec("arvot[0]+=1")

print(arvot[0])

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    print(arvot[0])
    ^^^^^
SyntaxError: invalid syntax

Test 5 (public)

Subtask: 1, 2, 3

Verdict:

input
INCREASE X
INCREASE X
INCREASE X
INCREASE X
INCREASE X
...

correct output
999 

user output

exec("arvot[23]+=1")

exec("arvot[23]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[23]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 6 (public)

Subtask: 1, 2, 3

Verdict:

input
PRINT X
PRINT X
PRINT X
PRINT X
PRINT X
...

correct output
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

user output

print(arvot[23])

print(arvot[23])

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    print(arvot[23])
    ^^^^^
SyntaxError: invalid syntax

Test 7 (public)

Subtask: 2, 3

Verdict:

input
INCREASE A
INCREASE A
INCREASE A
INCREASE A
INCREASE A
...

correct output
5 5 5 5 5 

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 8 (public)

Subtask: 2, 3

Verdict:

input
INCREASE A
INCREASE A
INCREASE A
INCREASE A
INCREASE A
...

correct output
0 0 0 0 0 

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 9 (public)

Subtask: 2, 3

Verdict:

input
INCREASE A
INCREASE A
INCREASE A
INCREASE A
INCREASE A
...

correct output
6 7 8 9 10 

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 10 (public)

Subtask: 2, 3

Verdict:

input
INCREASE A
INCREASE A
INCREASE A
INCREASE A
INCREASE A
...

correct output
5 5 

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 11 (public)

Subtask: 2, 3

Verdict:

input
INCREASE A
INCREASE A
INCREASE A
INCREASE A
INCREASE A
...

correct output
20 

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 12 (public)

Subtask: 2, 3

Verdict:

input
INCREASE A
INCREASE A

INCREASE B
INCREASE B
...

correct output
42 

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 13 (public)

Subtask: 3

Verdict:

input
INCREASE A
INCREASE A
INCREASE A
INCREASE A
INCREASE A
...

correct output
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 14 (public)

Subtask: 3

Verdict:

input
# Create number 3
INCREASE A INCREASE A INCREASE...

correct output
12 

user output

exec("arvot[45]=0")


exec("arvot[0]+=1")
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 5
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 15 (public)

Subtask: 3

Verdict:

input
INCREASE X
INCREASE X
INCREASE X
INCREASE X
INCREASE X
...

correct output
531441 

user output

exec("arvot[23]+=1")

exec("arvot[23]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[23]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 16 (public)

Subtask: 3

Verdict:

input
INCREASE A
INCREASE A
INCREASE A
INCREASE A
INCREASE A
...

correct output
1337 

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 17 (public)

Subtask: 3

Verdict:

input
INCREASE A
INCREASE A

REPEAT A TIMES (
    REPEAT A TIMES (
...

correct output
1 2 1 2 1 1 3 4 3 4 3 4 3 4 3 ...

user output

exec("arvot[0]+=1")

exec("arvot[0]+=1")

...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 4
    exec("arvot[0]+=1")
    ^^^^
SyntaxError: invalid syntax

Test 18 (public)

Subtask: 3

Verdict:

input
# Efficient algorithm for find...

correct output
2 3 5 7 11 13 17 19 23 29 31 3...

user output





...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 43, in <module>
    eval(koodi)
  File "<string>", line 10
    exec("arvot[23]+=1")
    ^^^^
SyntaxError: invalid syntax