QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#37688#1190. Twin Trees BrosZhangYiDeTL 3ms3884kbC++176.1kb2022-07-02 15:02:062022-07-02 15:02:07

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3860kb

input:

3
0 0 0
1 0 0
3 0 0
1 2
2 3
0 0 0
0 2 2
0 3 3
4 5
5 6

output:

1

result:

ok answer is '1'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3792kb

input:

4
1 0 0
2 0 0
2 1 0
2 -1 0
1 2
2 3
2 4
0 1 1
0 0 0
0 2 0
0 0 2
5 6
5 7
5 8

output:

2

result:

ok answer is '2'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

3
0 0 0
1 0 0
3 0 0
1 2
2 3
0 0 0
0 2 2
0 3 3
4 5
5 6

output:

1

result:

ok answer is '1'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3796kb

input:

7
5 3 1
5 5 3
5 1 -1
7 5 3
3 5 3
7 1 -1
3 1 -1
1 2
1 3
1 4
1 5
1 6
1 7
13 23 24
10 20 30
10 20 36
10 20 24
13 23 36
7 17 36
7 17 24
8 9
9 10
9 11
9 12
9 13
9 14

output:

4

result:

ok answer is '4'

Test #5:

score: 0
Accepted
time: 2ms
memory: 3816kb

input:

7
5 3 1
5 5 3
5 1 -1
7 5 3
3 5 3
7 1 -1
3 1 -1
1 2
1 3
1 4
1 5
1 6
1 7
13 23 24
13 23 36
10 20 30
10 20 36
10 20 24
7 17 36
7 17 24
8 9
9 10
10 11
10 12
10 13
10 14

output:

0

result:

ok answer is '0'

Test #6:

score: 0
Accepted
time: 2ms
memory: 3864kb

input:

7
5 3 1
5 5 3
5 1 -1
7 5 3
3 5 3
7 1 -1
3 1 -1
1 2
1 3
1 4
1 5
1 6
1 7
13 23 24
10 20 30
10 20 36
10 20 24
13 23 37
7 17 36
7 17 24
8 9
9 10
9 11
9 12
9 13
9 14

output:

0

result:

ok answer is '0'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

9
134 234 164
185 285 198
134 234 232
185 285 266
134 234 300
185 285 334
134 234 368
185 285 402
134 234 436
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
50 30 278
184 164 680
-84 -104 680
318 298 278
-218 -238 278
452 432 680
-352 -372 680
586 566 278
-486 -506 278
10 11
10 12
11 13
12 14
13 15
14 16
15 17
16 18

output:

2

result:

ok answer is '2'

Test #8:

score: 0
Accepted
time: 2ms
memory: 3872kb

input:

9
185 285 198
134 234 436
185 285 266
185 285 402
134 234 232
134 234 300
134 234 368
134 234 164
185 285 334
1 8
1 5
2 4
3 5
3 6
4 7
6 9
7 9
318 298 278
452 432 680
184 164 680
-218 -238 278
-352 -372 680
586 566 278
-486 -506 278
-84 -104 680
50 30 278
10 12
10 11
11 15
12 18
13 17
13 14
14 16
17 18

output:

2

result:

ok answer is '2'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3812kb

input:

9
185 285 198
134 234 436
185 285 266
185 285 402
134 234 232
134 234 300
134 234 368
134 234 164
185 285 334
1 8
1 5
2 6
3 5
3 6
4 7
6 9
7 9
318 298 278
452 432 680
184 164 680
-218 -238 278
-352 -372 680
586 566 278
-486 -506 278
-84 -104 680
50 30 278
10 12
10 11
11 15
12 18
13 17
13 14
14 16
17 18

output:

0

result:

ok answer is '0'

Test #10:

score: 0
Accepted
time: 2ms
memory: 3796kb

input:

9
185 285 198
134 235 436
185 285 266
185 285 402
134 234 232
134 234 300
134 234 368
134 234 164
185 285 334
1 8
1 5
2 4
3 5
3 6
4 7
6 9
7 9
318 298 278
452 432 680
184 164 680
-218 -238 278
-352 -372 680
586 566 278
-486 -506 278
-84 -104 680
50 30 278
10 12
10 11
11 15
12 18
13 17
13 14
14 16
17 18

output:

0

result:

ok answer is '0'

Test #11:

score: 0
Accepted
time: 2ms
memory: 3812kb

input:

7
-220 520 720
60 240 440
200 100 300
620 -320 -120
-80 380 580
480 -180 20
340 -40 160
1 3
1 7
1 6
1 4
2 3
3 5
230 210 370
50 30 10
170 150 250
-10 -30 -110
-130 -150 -350
110 90 130
-70 -90 -230
8 11
8 9
8 14
8 12
9 10
9 13

output:

1

result:

ok answer is '1'

Test #12:

score: 0
Accepted
time: 2ms
memory: 3808kb

input:

7
-220 520 720
60 240 440
200 100 300
620 -320 -120
-80 380 580
480 -180 20
340 -40 160
1 3
1 7
1 6
2 3
3 5
4 5
230 210 370
50 30 10
170 150 250
-10 -30 -110
-130 -150 -350
110 90 130
-70 -90 -230
8 11
8 9
8 14
8 12
9 10
9 13

output:

0

result:

ok answer is '0'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

7
-220 520 720
60 240 440
200 100 300
620 -320 -120
-80 380 580
480 -180 20
341 -40 161
1 3
1 7
1 6
1 4
2 3
3 5
230 210 370
50 30 10
170 150 250
-10 -30 -110
-130 -150 -350
110 90 130
-70 -90 -230
8 11
8 9
8 14
8 12
9 10
9 13

output:

0

result:

ok answer is '0'

Test #14:

score: 0
Accepted
time: 3ms
memory: 3816kb

input:

12
-356 -256 92
-356 -256 -12
-356 -256 612
-252 -152 612
-252 -152 508
-252 -152 92
-356 -256 508
-252 -152 196
-252 -152 -12
-252 -152 404
-356 -256 404
-356 -256 196
1 4
2 4
3 11
4 5
4 12
5 11
6 12
7 11
8 12
9 12
10 11
602 582 194
234 214 562
418 398 562
-134 -154 562
234 214 194
-134 -154 194
-3...

output:

1

result:

ok answer is '1'

Test #15:

score: 0
Accepted
time: 2ms
memory: 3676kb

input:

12
-356 -256 92
-356 -256 -12
-356 -256 612
-252 -152 612
-252 -152 508
-252 -152 92
-356 -256 508
-252 -152 196
-252 -152 -12
-252 -152 404
-356 -256 404
-356 -256 196
1 4
2 4
3 11
4 5
4 12
5 11
6 7
7 11
8 12
9 12
10 11
602 582 194
234 214 562
418 398 562
-134 -154 562
234 214 194
-134 -154 194
-31...

output:

0

result:

ok answer is '0'

Test #16:

score: 0
Accepted
time: 3ms
memory: 3808kb

input:

12
-356 -256 92
-356 -256 -12
-356 -256 612
-252 -152 612
-252 -152 508
-252 -152 93
-356 -256 508
-252 -152 196
-252 -152 -12
-252 -152 404
-356 -256 404
-356 -256 196
1 4
2 4
3 11
4 5
4 12
5 11
6 12
7 11
8 12
9 12
10 11
418 398 562
-502 -522 562
-134 -154 194
234 214 562
-502 -522 194
602 582 562
...

output:

0

result:

ok answer is '0'

Test #17:

score: 0
Accepted
time: 2ms
memory: 3872kb

input:

4
-500 -400 360
-500 -400 240
100 200 240
100 200 360
1 2
2 4
3 4
890 114 94
-790 114 94
890 -54 -74
-790 -54 -74
5 8
5 7
6 8

output:

2

result:

ok answer is '2'

Test #18:

score: 0
Accepted
time: 2ms
memory: 3820kb

input:

4
-500 -400 360
-500 -400 240
100 200 240
100 200 360
1 2
2 4
3 4
890 114 94
890 -54 -74
-790 114 94
-790 -54 -74
5 8
6 7
7 8

output:

0

result:

ok answer is '0'

Test #19:

score: 0
Accepted
time: 2ms
memory: 3744kb

input:

4
-500 -400 360
-500 -400 240
100 200 240
100 200 360
1 2
2 4
3 4
-790 114 94
890 -54 -75
890 114 94
-790 -54 -74
5 8
6 7
7 8

output:

0

result:

ok answer is '0'

Test #20:

score: 0
Accepted
time: 2ms
memory: 3748kb

input:

4
1 0 0
2 0 0
2 1 0
2 -1 0
1 2
2 3
2 4
0 1 1
0 0 0
0 2 0
0 0 2
5 6
5 7
5 8

output:

2

result:

ok answer is '2'

Test #21:

score: -100
Time Limit Exceeded

input:

199
-175 -10 195
-95 -125 390
-110 25 310
-105 -170 360
-145 -60 205
-340 -75 315
-305 -10 275
-245 -5 230
-175 5 390
-295 -40 230
-235 -90 205
-290 -225 310
-130 -5 360
-105 -45 260
-95 -190 275
-105 -30 345
-240 -5 355
-90 -15 365
-295 -155 260
-285 -165 410
-245 -195 370
-225 -115 160
-235 -195 2...

output:


result: