Submission details
Task:Z-array
Sender:aalto26ih_043
Submission time:2026-11-04 13:11:52 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.06 sdetails
#20.06 sdetails
#30.06 sdetails
#40.06 sdetails
#50.06 sdetails
#60.07 sdetails
#70.07 sdetails
#80.07 sdetails
#90.07 sdetails
#100.07 sdetails
#110.06 sdetails
#120.07 sdetails
#130.07 sdetails

Code

import sys

s = sys.stdin.read().strip().split('\n')
n = len(s)
prefixes = []
for i in range(n):
    count = 0
    while count < n - i:
        if s[i + count] != s[count]:
            break
        count+=1
    prefixes.append(count)
print(' '.join(prefixes))

Test details

Test 1

Verdict:

input
aaaaaaaaaa

correct output
10 9 8 7 6 5 4 3 2 1 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 2

Verdict:

input
ababababab

correct output
10 0 8 0 6 0 4 0 2 0 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 3

Verdict:

input
aabababaaa

correct output
10 1 0 1 0 1 0 2 2 1 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 4

Verdict:

input
ahtqqkhrrn

correct output
10 0 0 0 0 0 0 0 0 0 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 5

Verdict:

input
mqdozmqdoz

correct output
10 0 0 0 0 5 0 0 0 0 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 6

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
1000000 999999 999998 999997 9...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 7

Verdict:

input
ababababababababababababababab...

correct output
1000000 0 999998 0 999996 0 99...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 8

Verdict:

input
baaaabbabaabbbbaaaabbbababaaba...

correct output
1000000 0 0 0 0 1 2 0 3 0 0 1 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 9

Verdict:

input
ltpbdybvcpychbsplyonjfmdtsnqwt...

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

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 10

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
1000000 99998 99997 99996 9999...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 11

Verdict:

input
abaababaab

correct output
10 0 1 3 0 5 0 1 2 0 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 12

Verdict:

input
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

correct output
1000000 499999 499998 499997 4...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found

Test 13

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
1000000 147418 147417 147416 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 13, in <module>
    print(' '.join(prefixes))
TypeError: sequence item 0: expected str, int found