Submission details
Task:Conurbation
Sender:aalto26dw_003
Submission time:2026-09-23 17:20:56 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.07 sdetails
#20.07 sdetails
#30.07 sdetails
#40.07 sdetails
#50.07 sdetails
#60.07 sdetails
#70.07 sdetails
#80.07 sdetails
#90.07 sdetails
#100.07 sdetails
#110.07 sdetails
#120.07 sdetails
#130.07 sdetails
#140.07 sdetails
#150.07 sdetails
#160.07 sdetails
#170.07 sdetails
#180.07 sdetails
#190.07 sdetails
#200.07 sdetails
#210.07 sdetails
#220.07 sdetails
#230.07 sdetails
#240.07 sdetails
#250.07 sdetails
#260.07 sdetails
#270.07 sdetails
#280.07 sdetails
#290.07 sdetails
#300.07 sdetails
#310.07 sdetails
#320.07 sdetails
#330.07 sdetails
#340.07 sdetails
#350.07 sdetails
#360.07 sdetails
#370.07 sdetails
#380.07 sdetails
#390.07 sdetails
#400.07 sdetails
#410.07 sdetails
#420.07 sdetails
#430.07 sdetails
#440.07 sdetails
#450.07 sdetails
#460.08 sdetails
#470.07 sdetails
#480.08 sdetails
#490.07 sdetails
#500.08 sdetails
#510.07 sdetails
#520.10 sdetails
#530.10 sdetails
#540.10 sdetails
#550.10 sdetails
#560.10 sdetails
#570.09 sdetails
#580.10 sdetails
#590.08 sdetails
#600.10 sdetails
#610.19 sdetails
#620.20 sdetails
#630.18 sdetails
#640.19 sdetails
#650.23 sdetails
#660.16 sdetails
#670.22 sdetails
#680.15 sdetails
#690.21 sdetails

Code

import sys

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

a = [0] * (n + 1)
for i in range(1, n + 1):
    a[i] = a_in[i - 1]

LOG = 1
while (1 << LOG) < (n + m + 1):
    LOG += 1

total_nodes = n + m  
parent = [0] * (total_nodes + 1)     
create_time = [0] * (total_nodes + 1) 
pop = [0] * (total_nodes + 1)        
for i in range(1, n + 1):
    pop[i] = a[i]

dsu = list(range(total_nodes + 1))

def find(x):
    root = x
    while dsu[root] != root:
        root = dsu[root]
    while dsu[x] != root:
        dsu[x], x = root, dsu[x]
    return root

next_node = n
for year in range(1, m + 1):
    u, v, w = map(int, input().split())
    ru = find(u)
    rv = find(v)
    next_node += 1
    node = next_node
    create_time[node] = year

out = []
for _ in range(q):
    x, y = map(int, input().split())
    node = x
    for k in range(LOG - 1, -1, -1):
        p = up[k][node]
        if p != 0 and create_time[p] <= y:
            node = p
    out.append(str(pop[node]))

sys.stdout.write(" ".join(out))

Test details

Test 1

Verdict:

input
2 1 3
6 10 
1 2 6
1 1
2 1
...

correct output
22 22 22 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 2

Verdict:

input
2 1 3
5 3 
1 2 9
2 1
2 1
...

correct output
17 17 17 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 3

Verdict:

input
2 1 4
1 4 
1 2 7
1 1
2 1
...

correct output
12 12 12 12 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 4

Verdict:

input
3 1 8
6 5 1 
1 2 10
3 1
2 1
...

correct output
1 21 21 1 21 1 21 1 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 5

Verdict:

input
3 2 7
3 10 8 
1 2 8
1 3 7
2 2
...

correct output
36 21 21 8 21 36 36 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 6

Verdict:

input
3 3 5
9 6 2 
1 2 1
1 3 5
2 3 9
...

correct output
16 2 23 32 32 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 7

Verdict:

input
3 1 4
10 6 2 
1 2 5
2 1
2 1
...

correct output
21 21 21 21 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 8

Verdict:

input
4 6 8
2 3 1 1 
1 2 5
1 3 1
1 4 9
...

correct output
34 34 1 1 1 22 25 37 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 9

Verdict:

input
4 4 11
7 9 4 9 
1 4 9
2 3 8
2 4 1
...

correct output
9 25 25 56 25 25 25 25 56 4 4 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 10

Verdict:

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

correct output
58 60 25 58 60 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 11

Verdict:

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

correct output
25 16 44 36 6 44 36 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 12

Verdict:

input
5 7 12
7 1 4 9 10 
1 2 8
1 5 2
2 3 9
...

correct output
50 74 9 69 4 82 9 41 4 74 9 50...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 13

Verdict:

input
5 10 12
6 9 9 9 9 
1 2 1
1 3 9
1 4 1
...

correct output
68 58 34 44 34 75 58 16 68 68 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 14

Verdict:

input
5 3 5
7 7 9 6 7 
1 2 2
2 3 5
3 5 6
...

correct output
9 6 43 30 43 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 15

Verdict:

input
5 2 12
6 9 5 9 1 
1 3 2
2 5 1
2 1
...

correct output
9 13 13 13 13 9 9 9 13 13 13 9...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 16

Verdict:

input
5 10 11
4 3 1 6 3 
1 2 7
1 3 1
1 4 9
...

correct output
1 58 71 44 69 58 44 71 44 69 6...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 17

Verdict:

input
5 2 14
1 7 4 8 4 
2 5 6
3 5 5
2 2
...

correct output
26 1 1 8 4 1 17 17 4 26 8 4 26...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 18

Verdict:

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

correct output
56 68 68 68 68 76 76 48 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 19

Verdict:

input
5 4 13
6 7 9 9 4 
1 3 4
2 3 4
3 5 1
...

correct output
35 35 30 51 4 51 9 51 7 51 51 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 20

Verdict:

input
5 2 15
9 3 5 1 7 
2 3 5
2 5 8
3 1
...

correct output
13 28 28 13 28 1 1 1 13 13 28 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 21

Verdict:

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

correct output
61 2 61 67 49 67 67 67 26 49 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 22

Verdict:

input
10 14 25
10 8 2 9 9 10 5 8 9 5 
1 4 6
1 7 8
1 9 7
...

correct output
9 8 8 95 8 101 8 101 150 121 9...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 23

Verdict:

input
10 20 25
5 6 2 7 3 4 2 7 8 9 
1 3 5
1 7 1
1 9 1
...

correct output
71 6 4 117 54 71 99 4 112 24 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 24

Verdict:

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

correct output
3 6 47 47 19 65 59 8 32 47 

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 25

Verdict:

input
10 6 24
3 1 1 5 7 1 2 5 5 7 
1 2 3
1 3 3
2 6 4
...

correct output
7 5 7 7 1 5 16 1 7 5 5 11 5 5 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 26

Verdict:

input
10 19 21
5 2 5 1 1 7 2 2 9 8 
1 2 9
1 3 5
1 8 10
...

correct output
1 104 117 2 38 111 1 107 91 26...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 27

Verdict:

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

correct output
7 17 10 17 22 2 2 5 5 17 35 6 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 28

Verdict:

input
10 20 16
3 3 9 8 5 10 6 3 8 7 
1 5 8
1 6 6
1 10 8
...

correct output
132 120 164 9 120 172 172 90 4...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 29

Verdict:

input
10 8 26
9 9 4 4 4 1 7 3 7 10 
1 5 7
3 5 3
3 6 4
...

correct output
3 85 7 9 85 10 51 81 71 9 9 41...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 30

Verdict:

input
10 5 30
5 6 9 5 10 6 2 6 8 8 
1 5 5
3 9 8
4 6 9
...

correct output
20 25 8 5 25 20 8 6 5 20 25 20...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 31

Verdict:

input
10 10 20
8 6 2 9 2 7 10 6 6 8 
1 2 10
1 3 4
1 8 7
...

correct output
110 130 30 76 130 89 110 130 8...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 32

Verdict:

input
100 187 219
74 46 50 98 23 69 26 9 6 6 44 ...

correct output
60969 25642 39518 11438 50148 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 33

Verdict:

input
100 154 300
20 94 59 38 98 6 85 75 24 30 5...

correct output
46 77 76 68840 2 10 53 10 1355...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 34

Verdict:

input
100 159 137
30 59 62 100 96 44 45 37 21 88...

correct output
32922 36267 13295 4921 25077 5...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 35

Verdict:

input
100 188 114
98 52 51 37 83 27 8 81 48 91 7...

correct output
896 38 38016 75 929 55318 5531...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 36

Verdict:

input
100 292 281
28 36 41 54 58 1 12 54 80 36 3...

correct output
77560 25 83317 35 47239 42343 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 37

Verdict:

input
100 105 111
36 58 93 79 96 84 41 25 90 86 ...

correct output
25 41638 83 11 578 35 37057 51...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 38

Verdict:

input
100 274 290
84 5 74 40 28 45 73 16 32 18 1...

correct output
33 111825 139106 48081 95088 7...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 39

Verdict:

input
100 69 145
85 84 14 54 31 4 47 10 75 80 4...

correct output
1003 2691 46 54 45 85 1996 385...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 40

Verdict:

input
100 269 102
86 49 22 66 7 8 41 68 97 52 15...

correct output
94382 66968 26853 65546 61406 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 41

Verdict:

input
100 52 173
6 41 4 68 17 24 80 18 17 13 14...

correct output
1206 35 22 100 19 11 36 79 139...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 42

Verdict:

input
200 374 437
83 16 91 100 82 9 16 10 63 64 ...

correct output
7 131256 124647 183516 133600 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 43

Verdict:

input
200 308 599
26 22 12 45 20 49 50 34 73 1 2...

correct output
101488 71 87 16319 31 100814 8...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 44

Verdict:

input
200 318 274
25 10 95 52 56 33 36 87 1 75 2...

correct output
128489 72606 464 145651 6 1079...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 45

Verdict:

input
200 375 228
89 11 30 47 39 38 98 62 44 89 ...

correct output
161772 9 172295 112826 77 1522...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 46

Verdict:

input
200 584 561
16 3 98 85 5 99 11 18 17 49 99...

correct output
71 118148 217768 55 89638 1898...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 47

Verdict:

input
200 211 222
50 62 65 90 51 64 17 81 65 37 ...

correct output
20 60 83 101039 109091 2 1818 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 48

Verdict:

input
200 547 579
6 43 20 80 81 12 92 5 63 70 9 ...

correct output
84 114794 252841 255378 279356...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 49

Verdict:

input
200 138 291
81 95 55 35 17 71 4 47 29 39 8...

correct output
25 54 26334 60 67 45 3437 991 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 50

Verdict:

input
200 537 204
70 14 20 26 78 8 79 67 90 86 9...

correct output
272553 159000 231656 124672 79...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 51

Verdict:

input
200 105 346
85 74 55 46 27 77 58 73 32 81 ...

correct output
98 93 91 470 37 3 17 1141 15 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 52

Verdict:

input
1000 1872 2186
84 80 33 96 11 12 9 82 94 68 1...

correct output
213572 583269 845186 159953 87...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 53

Verdict:

input
1000 1542 2995
56 73 91 44 87 94 34 82 3 37 8...

correct output
195264 59 1415 799110 64 15852...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 54

Verdict:

input
1000 1590 1370
44 84 98 61 27 84 7 70 25 65 4...

correct output
31 65 701570 560095 388274 16 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 55

Verdict:

input
1000 1877 1141
25 11 88 77 91 36 62 61 79 84 ...

correct output
495761 78 455001 722437 81 371...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 56

Verdict:

input
1000 2918 2802
31 18 99 81 27 61 3 24 93 76 3...

correct output
1147264 289548 798155 824295 4...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 57

Verdict:

input
1000 1055 1110
50 42 74 15 11 36 43 92 70 59 ...

correct output
86 46 70 400514 48 462515 96 2...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 58

Verdict:

input
1000 2733 2895
84 7 16 7 52 67 52 11 18 12 25...

correct output
626156 300086 1144633 117105 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 59

Verdict:

input
1000 690 1454
40 86 79 58 75 14 93 78 70 29 ...

correct output
335 52 85 54 2458 1476 252478 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 60

Verdict:

input
1000 2684 1022
84 61 85 9 99 16 21 21 59 97 2...

correct output
1263182 290251 628913 1333935 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 61

Verdict:

input
100000 132325 159285
17 66 72 14 70 37 21 77 77 8 1...

correct output
26997290 43133384 15738489 536...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 62

Verdict:

input
100000 112555 199720
66 40 4 62 93 18 87 17 93 33 6...

correct output
53634787 50 13386258 910 46 35...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 63

Verdict:

input
100000 115401 118508
58 46 99 47 45 48 88 55 65 26 ...

correct output
47323160 60674434 55 18495 444...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 64

Verdict:

input
100000 132622 107072
96 14 46 26 86 95 48 16 57 1 5...

correct output
41 78 72 597 54188145 69570768...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 65

Verdict:

input
100000 195060 190063
59 52 10 99 9 91 4 50 40 100 5...

correct output
44 77677116 54830906 64 35 593...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 66

Verdict:

input
100000 83300 105518
34 24 50 62 68 7 20 19 22 13 8...

correct output
57 28 34883032 1639 34687735 3...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 67

Verdict:

input
100000 183934 194749
75 4 99 29 11 14 93 62 73 75 9...

correct output
50631809 42390149 89 11 21 787...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 68

Verdict:

input
100000 61446 122734
15 89 30 58 78 27 21 34 61 79 ...

correct output
77 1070 59 79 55 7 2219 55 189...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?

Test 69

Verdict:

input
100000 181019 101111
34 4 19 66 4 58 51 92 60 8 30 ...

correct output
4469 29 24653966 1503 87861918...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 45, in <module>
    p = up[k][node]
NameError: name 'up' is not defined. Did you mean: u?