QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#431710#4891. 树上的孤独carrotqq20 1603ms500700kbC++145.8kb2024-06-05 22:53:542024-06-05 22:53:55

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 29ms
memory: 125968kb

input:

20 2000 2000
8 15
8 13
14 8
14 7
12 14
12 1
9 13
9 4
5 9
5 10
2 5
2 19
6 19
6 16
11 7
11 20
18 2
18 17
3 6
1395 1783
1395 1735
1735 457
457 739
739 438
438 101
101 441
441 1879
1879 1238
1238 501
501 1732
1732 1910
1910 2000
2000 834
834 917
917 111
111 780
780 1966
1966 1604
1604 623
623 1748
1748 ...

output:

105
92
2
44
18
53
193
24
69
20
21
200
80
86
136
31
67
67
47
28
23
10
23
80
58
100
27
200
38
78
97
21
87
35
197
76
27
49
10
20
55
59
24
5
109
157
23
21
15
102
37
107
26
79
171
85
35
144
140
9
136
32
106
138
121
68
34
68
18
40
56
49
54
14
36
145
109
129
144
200
21
81
82
38
72
26
28
39
162
51
61
51
95
...

result:

wrong answer 2nd numbers differ - expected: '93', found: '92'

Subtask #2:

score: 20
Accepted

Test #3:

score: 20
Accepted
time: 1309ms
memory: 401492kb

input:

20 200000 500000
8 18
8 4
2 4
2 14
13 4
13 16
6 4
6 3
1 4
1 17
15 6
15 19
7 17
7 11
5 14
5 10
20 7
12 15
9 8
165302 77239
165302 198189
165302 180850
165302 192738
165302 173589
165302 194087
165302 191990
165302 167370
165302 101092
165302 92553
165302 163654
165302 122381
165302 152105
165302 1919...

output:

2
17595
3898
3423
16
518
5138
11355
21
7340
21
18327
15797
6638
514
1184
6110
1884
6241
662
16738
13230
1597
5446
6074
2387
6265
2
21
282
3511
1806
1236
1038
17804
4657
5536
4633
4547
21
244
2703
2
4610
8571
4037
21
13498
5648
2054
3489
4869
5828
802
2072
1482
13232
2593
938
16769
2
17623
353
5
21
7...

result:

ok 500000 numbers

Test #4:

score: 0
Accepted
time: 1403ms
memory: 404224kb

input:

20 200000 500000
11 2
11 1
17 1
17 6
10 2
10 16
20 6
20 15
12 1
12 4
9 16
9 3
7 1
13 15
8 15
8 5
18 7
18 14
19 12
146231 199607
146231 196481
196481 194263
194263 192044
192044 169873
169873 141903
141903 129271
129271 176167
176167 170198
170198 173775
173775 174130
174130 184691
184691 198900
1989...

output:

933
12179
2009
2889
5129
7229
2884
5588
1070
21
2789
2194
654
2643
7840
3203
3946
105
1626
4635
775
2
14
6001
18249
18326
2
1386
3505
11361
1254
4501
5630
21
12011
1392
2902
5252
7857
4
1038
1796
3342
129
19959
18597
1924
116
104
1603
3593
4365
3967
921
1007
2344
4728
3051
2048
4607
4563
1648
8059
3...

result:

ok 500000 numbers

Test #5:

score: 0
Accepted
time: 1324ms
memory: 408652kb

input:

20 200000 500000
11 19
11 12
6 12
6 8
20 19
20 7
1 6
1 2
9 11
9 10
15 6
15 17
3 7
3 14
13 19
4 13
4 18
5 6
5 16
164001 91176
164001 174000
174000 170154
170154 69790
69790 174420
174420 193462
193462 149823
149823 188081
188081 127489
127489 191901
191901 194376
194376 197936
197936 185448
185448 19...

output:

5329
19807
5406
4355
2
1453
3216
21
2758
2561
387
8122
6615
4577
6108
2
2224
586
2950
19824
3119
6437
4852
5552
17244
7466
5462
2909
9992
19918
6653
19811
448
1026
1467
424
21
3056
1866
4262
9943
6499
3180
3688
6479
5096
6369
21
232
1765
2369
1789
1942
1141
3690
8680
7346
5265
21
16599
701
4354
1413...

result:

ok 500000 numbers

Test #6:

score: 0
Accepted
time: 1268ms
memory: 413384kb

input:

20 200000 500000
17 5
17 11
18 5
18 14
1 17
1 3
16 18
16 13
7 16
7 15
9 15
9 4
12 11
12 2
20 14
20 19
8 9
8 10
6 17
166750 113956
166750 160259
160259 143147
143147 172478
172478 173006
173006 89817
89817 196218
196218 191942
191942 193748
193748 177077
177077 157435
157435 125058
125058 164374
1643...

output:

2490
7164
1575
19999
2452
1702
26
21
5118
19981
10942
21
21
19266
1523
13
21
6341
21
1040
581
1643
7021
16863
7376
1626
1211
1982
21
15029
10542
14571
135
21
1001
21
1390
4982
2928
1539
5422
1095
2923
4872
1377
19997
14571
7196
4640
1988
1707
5216
5742
17354
12204
1941
17445
516
21
13
14682
19992
21...

result:

ok 500000 numbers

Subtask #3:

score: 0
Wrong Answer

Test #7:

score: 0
Wrong Answer
time: 315ms
memory: 216852kb

input:

20 100000 100000
16 12
16 20
6 12
6 18
2 16
2 8
5 20
5 13
3 6
3 11
19 11
19 17
9 12
9 15
4 15
4 7
10 5
14 15
14 1
85812 94626
85812 91172
91172 93788
93788 96567
96567 75524
75524 23275
23275 98340
98340 81608
81608 91480
91480 75108
75108 56605
56605 93317
93317 41617
41617 77160
77160 727
727 7559...

output:

2567
612
8337
8985
3560
9182
648
301
2478
7307
2681
1171
1402
1268
8228
4403
109
2694
640
4476
3166
9184
21
8979
2092
9950
8006
9944
21
5040
89
2034
1881
19
1292
2184
336
1104
9386
3475
7723
1958
2741
1253
2331
716
21
545
21
446
699
2332
447
18
38
1424
2321
691
2463
21
2320
711
9999
8
196
1366
8934
...

result:

wrong answer 1st numbers differ - expected: '2568', found: '2567'

Subtask #4:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 868ms
memory: 298160kb

input:

1 200000 500000
189127 137023
189127 199761
199761 160701
160701 130639
130639 190908
190908 176819
176819 193363
193363 188021
188021 182446
182446 186028
186028 198828
198828 190792
190792 155378
155378 189428
189428 177276
177276 146159
146159 175923
175923 188073
188073 182206
182206 131072
1310...

output:

3782
1773
771
7329
18160
19394
1952
2
5499
2
2859
3369
7393
5131
5707
2
6002
19866
2
5124
2
12549
1497
4837
7771
16333
18175
5926
17983
19707
3821
17709
17093
4226
3822
576
5638
3660
4987
15686
2
18775
29
5068
16605
2276
16601
4545
598
845
19976
7055
882
164
2744
1683
6747
5091
1632
5136
2930
2778
1...

result:

wrong answer 4th numbers differ - expected: '7328', found: '7329'

Subtask #5:

score: 0
Wrong Answer

Test #15:

score: 0
Wrong Answer
time: 1603ms
memory: 500700kb

input:

20 200000 1000000
13 10
13 5
19 5
19 20
15 10
15 6
12 6
12 3
8 10
8 2
1 20
1 11
14 10
14 16
18 3
18 7
4 3
9 10
9 17
194055 154514
194055 148156
148156 115271
115271 198116
198116 179433
179433 171975
171975 196600
196600 167194
167194 185078
185078 191409
191409 163496
163496 178243
178243 154093
15...

output:

459
5817
10120
7654
4894
19469
3577
16028
2835
7538
1131
9925
18495
497
11876
2132
9850
7577
7279
111
1851
7390
3349
6105
19488
16461
6208
1725
5923
5595
3818
1918
718
3318
2715
19890
5605
636
753
1301
15995
2973
1671
14676
5222
2645
118
1895
3266
1935
14602
4578
7219
5904
11033
4392
7458
9754
19632...

result:

wrong answer 17th numbers differ - expected: '9849', found: '9850'