QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#51790#4864. Symmetry: TreelarryzhongAC ✓222ms3900kbC++172.8kb2022-10-04 02:26:192022-10-04 02:26:22

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

YES
-1 -1
2 -2
1 -1
-2 -2
1 0 0
YES
-1 -1
1 -1
0 -2
0 0
1 0 0
YES
0 2
-2 -2
0 -3
0 0
0 3
-1 -1
2 -2
0 1
1 -1
1 0 0
NO
NO

result:

ok 5 test cases (5 test cases)

Test #2:

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

input:

1000
911
585 506
106 506
888 585
31 888
194 888
668 31
585 839
106 112
839 298
668 377
839 301
506 300
206 888
506 88
112 467
656 506
467 830
601 888
839 281
310 668
600 888
310 642
426 656
102 88
319 112
530 600
261 319
550 585
701 377
300 878
506 612
165 319
102 447
697 206
516 642
300 365
31 4
88...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
0 -6
0 -4
-3 -3
2 -2
0 0
3 -3
0 -5
-1 -1
-2 -2
1 -1
1 0 0
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
N...

result:

ok 1000 test cases (1000 test cases)

Test #3:

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

input:

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

output:

YES
0 -4
3 -2
-3 -2
-1 -1
-2 -2
2 -2
1 -1
0 2
0 0
0 1
1 0 0

result:

ok 1 test cases (1 test case)

Test #4:

score: 0
Accepted
time: 4ms
memory: 3656kb

input:

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

output:

NO
YES
0 -3
1 -1
0 -2
-1 -1
0 0
1 0 0
YES
-2 -2
1 -1
2 -2
-1 -1
1 0 0
NO
YES
0 2
-1 -3
1 -3
1 -1
0 -2
-1 -1
0 1
0 0
1 0 0
YES
0 0
0 -3
0 -2
-1 -1
1 -1
1 0 0
NO
NO
YES
-1 -1
1 -1
1 0 0
YES
-1 -1
1 -1
0 0
1 0 0
YES
-1 -1
0 0
2 -1
-2 -1
3 -2
1 -1
-3 -2
1 0 0
YES
2 -2
-1 -1
1 -1
0 0
-2 -2
1 0 0
NO
YES
2...

result:

ok 1000 test cases (1000 test cases)

Test #5:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

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

output:

NO
YES
0 -3
1 -1
0 -4
0 0
-1 -1
0 -2
1 0 0
YES
0 0
1 0 0
YES
0 -2
0 -3
1 -1
-1 -1
0 0
1 0 0
YES
0 0
0 -2
0 -3
1 -1
-1 -1
1 0 0
YES
-1 -1
1 -1
1 0 0
YES
0 0
0 -3
-1 -1
1 -1
0 -2
1 0 0
YES
-2 -2
-1 -1
1 -1
2 -2
1 0 0
YES
-3 -2
-1 -1
-2 -2
2 -2
1 -1
3 -2
1 0 0
YES
1 -1
0 0
-1 -1
2 -2
-2 -2
1 0 0
YES
-2...

result:

ok 1000 test cases (1000 test cases)

Test #6:

score: 0
Accepted
time: 25ms
memory: 3788kb

input:

1000
35
9 7
9 4
4 30
5 30
18 7
7 19
4 10
15 4
6 10
21 15
2 21
6 11
19 22
16 18
13 6
21 20
15 1
3 10
6 17
12 21
15 23
33 10
2 31
35 11
10 24
15 29
27 11
2 26
34 13
20 32
5 28
5 8
28 25
14 8
6
2 5
6 5
3 6
5 4
1 5
86
8 7
8 11
57 7
7 82
8 75
57 78
30 11
7 3
79 8
42 8
7 38
78 23
30 40
8 48
7 76
21 8
7 84...

output:

YES
-2 -2
-7 -3
2 -2
0 0
-13 -2
5 -2
13 -2
-16 -3
12 -1
1 -1
7 -3
-6 -3
10 -3
-17 -4
-1 -1
15 -4
6 -3
14 -3
16 -3
-10 -3
-5 -2
17 -4
-3 -2
4 -2
-15 -4
-9 -4
9 -4
-14 -3
-4 -2
-12 -1
-8 -4
-11 -4
3 -2
11 -4
8 -4
1 0 0
YES
0 -2
1 -1
0 2
-1 -1
0 0
0 1
1 0 0
YES
-8 -4
-16 -6
-2 -2
30 -4
-24 -6
-34 -5
-1...

result:

ok 1000 test cases (1000 test cases)

Test #7:

score: 0
Accepted
time: 25ms
memory: 3840kb

input:

1000
50
47 9
47 27
27 50
50 4
4 13
30 13
30 20
24 20
19 24
29 19
29 44
44 39
49 39
49 17
17 35
35 48
6 48
46 6
46 33
12 33
1 12
26 1
26 43
3 43
3 38
15 38
15 36
40 36
40 34
10 34
42 10
21 19
45 19
32 26
7 26
50 8
50 41
1 22
16 1
7 37
23 32
33 31
18 33
2 29
14 29
5 43
43 28
39 11
39 25
17
16 7
7 15
8...

output:

YES
0 6
1 -8
0 13
0 -15
1 12
0 1
-1 9
1 -17
0 -20
0 19
1 -5
0 5
0 -14
-1 -8
0 15
-1 7
0 -2
-1 4
0 -9
0 -12
1 -10
1 7
2 10
0 -11
-1 -5
0 8
0 -18
-1 12
0 -7
0 -13
1 4
1 9
0 3
0 18
0 -1
0 16
-2 10
0 14
0 -4
0 17
-1 -17
0 20
0 11
0 -6
-1 -10
0 2
0 -19
0 0
0 -3
0 -16
1 0 0
YES
0 0
0 -3
0 -8
0 -4
0 -6
-1 ...

result:

ok 1000 test cases (1000 test cases)

Test #8:

score: 0
Accepted
time: 222ms
memory: 3900kb

input:

1000
911
714 436
436 737
737 813
813 662
662 409
409 769
321 769
321 230
249 230
249 166
166 740
877 740
124 877
304 124
361 304
733 361
174 733
503 174
503 544
335 544
335 783
333 783
367 333
367 559
902 559
902 94
94 147
569 147
195 569
298 195
298 96
96 50
50 853
207 853
207 602
602 897
480 897
3...

output:

YES
0 71
0 -259
0 126
0 -148
5 -250
0 70
5 -27
1 -1
0 -61
-1 270
3 -26
0 -126
-2 -201
3 223
0 226
0 -208
6 -16
-1 -151
3 -194
0 -183
1 125
0 -192
0 1
1 301
-5 176
0 -196
1 61
-2 251
1 -158
2 147
0 30
-1 298
0 -163
-3 185
0 -12
1 129
0 211
0 152
-3 38
-1 -5
0 -80
4 110
-3 82
-1 -193
-2 -206
0 -49
-1 ...

result:

ok 1000 test cases (1000 test cases)

Test #9:

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

input:

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

output:

YES
1 3
0 2
-1 3
0 1
0 0
1 -1
-1 -1
0 -2
1 0 0

result:

ok 1 test cases (1 test case)