Submission details
Task:Terrible security
Sender:aalto26fm_015
Submission time:2026-10-05 17:25:01 +0300
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.06 sdetails
#70.06 sdetails
#80.06 sdetails
#90.06 sdetails
#100.06 sdetails
#110.06 sdetails
#120.06 sdetails
#130.06 sdetails
#140.06 sdetails
#150.06 sdetails
#160.06 sdetails
#170.06 sdetails
#180.06 sdetails
#190.06 sdetails
#200.06 sdetails
#210.06 sdetails
#220.06 sdetails
#230.06 sdetails
#240.06 sdetails
#250.06 sdetails
#260.06 sdetails
#270.06 sdetails
#280.06 sdetails
#290.06 sdetails
#300.06 sdetails
#310.06 sdetails
#320.06 sdetails
#330.06 sdetails
#340.06 sdetails
#350.06 sdetails
#360.06 sdetails
#370.06 sdetails
#380.06 sdetails
#390.07 sdetails
#400.06 sdetails
#410.07 sdetails
#420.06 sdetails
#430.07 sdetails
#440.06 sdetails
#450.06 sdetails
#460.06 sdetails
#470.06 sdetails
#480.06 sdetails
#490.08 sdetails
#500.06 sdetails
#510.07 sdetails
#520.07 sdetails
#530.07 sdetails
#540.06 sdetails
#550.07 sdetails
#560.07 sdetails
#570.08 sdetails
#580.10 sdetails
#590.11 sdetails
#600.08 sdetails
#610.11 sdetails
#620.07 sdetails
#630.12 sdetails
#640.08 sdetails
#650.13 sdetails
#660.18 sdetails
#670.20 sdetails
#680.20 sdetails
#69--details
#70--details
#71--details
#72--details
#73--details
#74--details

Code

import sys

sys.setrecursionlimit(200000)

def main():

    n, q = list(map(int, input().split()))

    lockers = list(map(int, input().split()))

    starting_key = list(map(int, input().split()))


    visited = set()
    flag = True

    count = 0

    def helper(number):
        nonlocal flag
        nonlocal count

        if not flag:
            return

        found_number = lockers[number - 1]

        if found_number in visited:
            flag = False
            return

        count += 1
        visited.add(found_number)

        helper(found_number)

    return_array = []


    for number in starting_key:

        flag = True

        helper(number)

        return_array.append(count)

        count = 0

        visited.clear()

    print(" ".join(map(str, return_array)))

def main2():

    n, q = map(int, input().split())

    lockers = list(map(int, input().split()))
    starting_key = list(map(int, input().split()))

    visited = set()
    answer = [0] * (n + 1)

    for number in range(1, n + 1):

        if number in visited:
            continue

        cycle = []
        current = number

        while current not in visited:
            visited.add(current)
            cycle.append(current)
            current = lockers[current - 1]

        count = len(cycle)

        for node in cycle:
            answer[node] = count

    return_array = []

    for number in starting_key:
        return_array.append(answer[number])

    print(" ".join(map(str, return_array)))


main()








main2()

Test details

Test 1

Verdict:

input
1 1
1 
1 

correct output
1 

user output
1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 2

Verdict:

input
2 2
2 1 
1 1 

correct output
2 2 

user output
2 2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 3

Verdict:

input
2 1
1 2 
1 

correct output
1 

user output
1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 4

Verdict:

input
3 1
2 1 3 
3 

correct output
1 

user output
1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 5

Verdict:

input
3 1
2 1 3 
2 

correct output
2 

user output
2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 6

Verdict:

input
3 3
1 2 3 
2 3 3 

correct output
1 1 1 

user output
1 1 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 7

Verdict:

input
3 1
1 2 3 
3 

correct output
1 

user output
1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 8

Verdict:

input
3 2
1 3 2 
3 1 

correct output
2 1 

user output
2 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 9

Verdict:

input
4 3
1 2 4 3 
1 1 3 

correct output
1 1 2 

user output
1 1 2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 10

Verdict:

input
4 3
2 3 1 4 
1 2 2 

correct output
3 3 3 

user output
3 3 3

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 11

Verdict:

input
4 3
1 2 3 4 
4 1 3 

correct output
1 1 1 

user output
1 1 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 12

Verdict:

input
4 1
3 4 1 2 
1 

correct output
2 

user output
2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 13

Verdict:

input
4 4
2 1 3 4 
3 4 1 1 

correct output
1 1 2 2 

user output
1 1 2 2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 14

Verdict:

input
4 3
2 1 3 4 
2 1 1 

correct output
2 2 2 

user output
2 2 2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 15

Verdict:

input
5 5
1 3 2 4 5 
3 5 3 4 4 

correct output
2 1 2 1 1 

user output
2 1 2 1 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 16

Verdict:

input
5 1
1 3 2 5 4 
1 

correct output
1 

user output
1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 17

Verdict:

input
5 5
1 2 5 4 3 
3 3 3 2 2 

correct output
2 2 2 1 1 

user output
2 2 2 1 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 18

Verdict:

input
5 1
1 2 3 4 5 
3 

correct output
1 

user output
1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 19

Verdict:

input
5 5
3 4 5 1 2 
3 1 5 5 4 

correct output
5 5 5 5 5 

user output
5 5 5 5 5

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 20

Verdict:

input
5 2
1 4 3 5 2 
5 5 

correct output
3 3 

user output
3 3

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 21

Verdict:

input
5 2
1 5 3 2 4 
5 1 

correct output
3 1 

user output
3 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 22

Verdict:

input
5 4
1 2 3 4 5 
3 5 2 3 

correct output
1 1 1 1 

user output
1 1 1 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 23

Verdict:

input
5 2
3 1 2 4 5 
5 2 

correct output
1 3 

user output
1 3

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 24

Verdict:

input
5 1
1 2 4 3 5 
2 

correct output
1 

user output
1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 25

Verdict:

input
10 5
6 2 4 5 3 1 7 8 10 9 
7 7 4 5 3 

correct output
1 1 3 3 3 

user output
1 1 3 3 3

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 26

Verdict:

input
10 10
7 2 9 4 1 5 6 10 3 8 
2 3 1 4 2 4 4 7 4 10 

correct output
1 2 4 1 1 1 1 4 1 2 

user output
1 2 4 1 1 1 1 4 1 2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 27

Verdict:

input
10 5
2 1 3 8 7 10 5 4 6 9 
4 4 2 3 7 

correct output
2 2 2 1 2 

user output
2 2 2 1 2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 28

Verdict:

input
10 9
1 7 5 4 3 2 8 6 9 10 
5 9 1 2 1 3 3 1 1 

correct output
2 1 1 4 1 2 2 1 1 

user output
2 1 1 4 1 2 2 1 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 29

Verdict:

input
10 10
3 4 5 6 7 8 9 10 1 2 
6 2 10 9 8 7 7 6 3 2 

correct output
5 5 5 5 5 5 5 5 5 5 

user output
5 5 5 5 5 5 5 5 5 5

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 30

Verdict:

input
10 5
1 4 6 5 9 7 3 8 2 10 
1 7 4 8 4 

correct output
1 3 4 1 4 

user output
1 3 4 1 4

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 31

Verdict:

input
10 1
9 5 1 4 2 10 3 7 6 8 
4 

correct output
1 

user output
1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 32

Verdict:

input
10 10
1 3 2 5 4 6 7 10 8 9 
4 6 3 6 1 1 5 3 1 5 

correct output
2 1 2 1 1 1 2 2 1 2 

user output
2 1 2 1 1 1 2 2 1 2

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 33

Verdict:

input
10 6
8 6 3 10 1 5 7 2 4 9 
9 3 5 1 7 5 

correct output
3 1 5 5 1 5 

user output
3 1 5 5 1 5

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 34

Verdict:

input
10 1
1 4 2 3 7 5 6 8 9 10 
3 

correct output
3 

user output
3

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 35

Verdict:

input
100 78
8 2 4 12 9 1 7 6 3 11 10 5 15 ...

correct output
11 8 3 2 1 1 1 5 8 5 1 5 6 1 4...

user output
11 8 3 2 1 1 1 5 8 5 1 5 6 1 4...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 36

Verdict:

input
100 6
7 17 9 15 1 5 6 19 16 8 20 12 ...

correct output
3 7 3 5 10 7 

user output
3 7 3 5 10 7

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 37

Verdict:

input
100 35
2 1 3 4 5 8 15 14 6 7 11 9 12 ...

correct output
5 12 2 2 12 13 13 12 7 12 3 12...

user output
5 12 2 2 12 13 13 12 7 12 3 12...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 38

Verdict:

input
100 98
1 2 18 5 7 15 11 19 6 3 17 10 ...

correct output
16 7 14 11 4 11 14 14 14 16 14...

user output
16 7 14 11 4 11 14 14 14 16 14...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 39

Verdict:

input
100 91
3 4 5 6 7 8 9 10 11 12 13 14 1...

correct output
50 50 50 50 50 50 50 50 50 50 ...

user output
50 50 50 50 50 50 50 50 50 50 ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 40

Verdict:

input
100 57
6 5 3 2 4 1 14 17 36 41 32 22 ...

correct output
1 2 12 2 1 7 5 10 3 10 10 29 1...

user output
1 2 12 2 1 7 5 10 3 10 10 29 1...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 41

Verdict:

input
100 58
11 92 21 40 79 26 20 7 53 16 3...

correct output
18 68 68 18 68 18 18 68 68 68 ...

user output
18 68 68 18 68 18 18 68 68 68 ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 42

Verdict:

input
100 47
23 5 11 3 16 21 13 10 8 18 15 ...

correct output
15 15 10 10 10 10 1 5 10 10 7 ...

user output
15 15 10 10 10 10 1 5 10 10 7 ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 43

Verdict:

input
100 54
42 57 3 73 56 79 95 17 60 23 8...

correct output
72 8 72 18 72 72 18 72 1 72 72...

user output
72 8 72 18 72 72 18 72 1 72 72...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 44

Verdict:

input
100 8
16 14 30 28 23 1 26 25 8 22 13...

correct output
21 3 1 1 6 21 1 4 

user output
21 3 1 1 6 21 1 4

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 45

Verdict:

input
200 32
8 2 4 12 9 1 7 6 3 11 10 5 15 ...

correct output
11 1 15 15 11 5 5 8 9 11 15 3 ...

user output
11 1 15 15 11 5 5 8 9 11 15 3 ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 46

Verdict:

input
200 30
7 17 9 15 1 5 6 19 16 8 20 12 ...

correct output
13 1 5 2 10 4 11 4 13 11 6 4 1...

user output
13 1 5 2 10 4 11 4 13 11 6 4 1...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 47

Verdict:

input
200 87
2 1 3 4 5 8 15 14 6 7 11 9 12 ...

correct output
6 6 3 14 3 12 3 2 4 2 2 9 11 1...

user output
6 6 3 14 3 12 3 2 4 2 2 9 11 1...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 48

Verdict:

input
200 75
1 2 18 5 7 15 11 19 6 3 17 10 ...

correct output
10 8 5 7 9 9 10 7 10 7 2 1 3 1...

user output
10 8 5 7 9 9 10 7 10 7 2 1 3 1...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 49

Verdict:

input
200 181
3 4 5 6 7 8 9 10 11 12 13 14 1...

correct output
100 100 100 100 100 100 100 10...

user output
100 100 100 100 100 100 100 10...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 50

Verdict:

input
200 63
6 5 10 2 8 1 3 4 9 12 11 7 82 ...

correct output
19 22 19 39 1 19 7 39 6 4 27 3...

user output
19 22 19 39 1 19 7 39 6 4 27 3...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 51

Verdict:

input
200 99
11 92 21 164 79 144 20 7 105 1...

correct output
138 38 138 138 138 138 138 2 1...

user output
138 38 138 138 138 138 138 2 1...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 52

Verdict:

input
200 52
31 25 18 4 38 19 46 29 8 44 21...

correct output
57 57 13 42 24 57 15 42 57 42 ...

user output
57 57 13 42 24 57 15 42 57 42 ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 53

Verdict:

input
200 95
42 57 3 119 56 173 95 191 60 1...

correct output
144 144 144 32 144 144 144 144...

user output
144 144 144 32 144 144 144 144...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 54

Verdict:

input
200 11
16 67 30 28 23 1 38 61 64 22 1...

correct output
63 16 63 47 47 12 47 3 6 47 1 

user output
63 16 63 47 47 12 47 3 6 47 1

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 55

Verdict:

input
1000 411
8 2 4 12 9 1 7 6 3 11 10 5 15 ...

correct output
3 11 1 8 9 1 1 6 12 1 1 7 4 14...

user output
3 11 1 8 9 1 1 6 12 1 1 7 4 14...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 56

Verdict:

input
1000 186
7 17 9 15 1 5 6 19 16 8 20 12 ...

correct output
13 3 2 10 17 4 12 3 1 7 9 8 11...

user output
13 3 2 10 17 4 12 3 1 7 9 8 11...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 57

Verdict:

input
1000 952
2 1 3 4 5 8 15 14 6 7 11 9 12 ...

correct output
5 19 7 7 5 4 1 14 11 8 3 6 12 ...

user output
5 19 7 7 5 4 1 14 11 8 3 6 12 ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 58

Verdict:

input
1000 975
1 2 18 5 7 15 11 19 6 3 17 10 ...

correct output
1 5 3 4 5 6 9 8 1 15 10 15 4 2...

user output
1 5 3 4 5 6 9 8 1 15 10 15 4 2...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 59

Verdict:

input
1000 901
3 4 5 6 7 8 9 10 11 12 13 14 1...

correct output
500 500 500 500 500 500 500 50...

user output
500 500 500 500 500 500 500 50...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 60

Verdict:

input
1000 294
6 22 37 28 14 56 55 49 29 12 4...

correct output
30 231 231 290 290 290 244 2 1...

user output
30 231 231 290 290 290 244 2 1...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 61

Verdict:

input
1000 635
446 970 21 164 995 689 783 426...

correct output
681 681 681 681 83 83 681 198 ...

user output
681 681 681 681 83 83 681 198 ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 62

Verdict:

input
1000 59
217 160 224 49 38 19 46 194 8 ...

correct output
27 52 333 333 23 333 333 27 33...

user output
27 52 333 333 23 333 333 27 33...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 63

Verdict:

input
1000 981
451 340 330 827 925 173 494 19...

correct output
634 634 149 634 634 634 634 63...

user output
634 634 149 634 634 634 634 63...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 64

Verdict:

input
1000 250
16 272 312 28 23 258 144 194 2...

correct output
186 70 88 70 186 246 70 88 246...

user output
186 70 88 70 186 246 70 88 246...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 65

Verdict:

input
100000 15183
8 2 4 12 9 1 7 6 3 11 10 5 15 ...

correct output
3 2 8 9 6 4 18 7 13 8 3 6 10 1...

user output
3 2 8 9 6 4 18 7 13 8 3 6 10 1...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 66

Verdict:

input
100000 80738
7 17 9 15 1 5 6 19 16 8 20 12 ...

correct output
9 2 2 2 8 8 7 4 12 9 5 4 14 6 ...

user output
9 2 2 2 8 8 7 4 12 9 5 4 14 6 ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 67

Verdict:

input
100000 88540
2 1 3 4 5 8 15 14 6 7 11 9 12 ...

correct output
4 13 2 2 3 1 15 11 4 2 12 13 1...

user output
4 13 2 2 3 1 15 11 4 2 12 13 1...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 68

Verdict:

input
100000 95145
1 2 18 5 7 15 11 19 6 3 17 10 ...

correct output
12 8 5 2 1 9 13 17 5 14 1 11 5...

user output
12 8 5 2 1 9 13 17 5 14 1 11 5...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 99, in <module>
    main2()
  File "/box/input/code.py", line 56, in main2
    n, q = map(int, input().split())
EOFError

Test 69

Verdict:

input
100000 90064
3 4 5 6 7 8 9 10 11 12 13 14 1...

correct output
50000 50000 50000 50000 50000 ...

user output
(empty)

Test 70

Verdict:

input
100000 98544
1197 327 641 3158 2038 1048 56...

correct output
51677 37867 37867 216 51677 51...

user output
(empty)

Test 71

Verdict:

input
100000 57490
70439 82301 64482 96766 51484 ...

correct output
11976 62820 62820 62820 2808 6...

user output
(empty)

Test 72

Verdict:

input
100000 72506
16265 2606 21836 8643 4486 321...

correct output
44533 16055 11222 11222 16055 ...

user output
(empty)

Test 73

Verdict:

input
100000 64645
47136 80135 73346 78143 9204 6...

correct output
13351 40626 40626 40626 40414 ...

user output
(empty)

Test 74

Verdict:

input
100000 6200
17945 16321 396 7538 19397 151...

correct output
115 13754 19010 13754 9095 137...

user output
(empty)