QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#19294#952. Spring cleaningqwq34 185ms36964kbC++205.4kb2022-01-29 00:07:042022-05-06 04:37:56

详细

Subtask #1:

score: 0
Accepted

Test #1:

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

input:

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

output:

-1
10
8

result:

ok 3 lines

Test #2:

score: 0
Accepted
time: 185ms
memory: 21376kb

input:

20000 5000
9844 2753
14120 15267
6630 9346
16091 21
11589 11672
7243 10729
9376 18990
19172 16424
15329 4466
19473 2205
9722 13188
13805 12632
9639 7877
10960 12697
1725 10231
13383 4059
9258 10586
18536 11667
5581 666
1382 7072
17656 11359
10793 10158
18150 13161
9758 4811
280 4330
3962 17592
10138...

output:

23481
23486
23454
23478
23458
23463
23487
23449
23474
23459
23479
23466
23475
23473
23473
23466
23461
23472
23469
23474
23462
23454
23467
23453
23472
23460
23456
23460
23469
23456
23469
23470
23463
23463
23470
23470
23457
23460
23457
23469
23481
23459
23449
23462
23467
23469
23460
23477
23455
23462
...

result:

ok 5000 lines

Subtask #2:

score: 9
Accepted

Test #3:

score: 9
Accepted
time: 13ms
memory: 21196kb

input:

3000 1
1 592
1 797
1 1542
1 1567
1 2784
1 455
1 140
1 2242
1 910
1 1018
1 961
1 661
1 2408
1 1791
1 776
1 2894
1 369
1 435
1 2441
1 519
1 2223
1 102
1 1478
1 2261
1 1920
1 2541
1 1835
1 1918
1 848
1 25
1 1993
1 1020
1 2852
1 719
1 226
1 2
1 156
1 13
1 748
1 2521
1 1762
1 2164
1 2905
1 2949
1 2994
1 ...

output:

84526

result:

ok single line: '84526'

Test #4:

score: 0
Accepted
time: 17ms
memory: 20680kb

input:

3000 1
1 2019
1 111
1 1364
1 1771
1 2378
1 2159
1 573
1 207
1 2070
1 620
1 888
1 335
1 2837
1 1317
1 221
1 2000
1 2633
1 1302
1 644
1 472
1 1874
1 1882
1 1309
1 2781
1 2213
1 2904
1 1085
1 389
1 2838
1 91
1 1107
1 1086
1 1627
1 949
1 1394
1 883
1 2744
1 2385
1 2298
1 799
1 2313
1 315
1 498
1 2873
1 ...

output:

-1

result:

ok single line: '-1'

Test #5:

score: 0
Accepted
time: 77ms
memory: 35304kb

input:

100000 1
1 54145
1 79089
1 74333
1 80683
1 71589
1 36284
1 36065
1 23877
1 52252
1 79993
1 54257
1 38347
1 33461
1 80038
1 69156
1 67331
1 35581
1 91618
1 5993
1 38827
1 37059
1 50347
1 65914
1 64402
1 56981
1 32705
1 73315
1 11098
1 61719
1 12911
1 37000
1 57320
1 80865
1 39114
1 56767
1 62511
1 41...

output:

105104

result:

ok single line: '105104'

Test #6:

score: 0
Accepted
time: 108ms
memory: 30996kb

input:

70000 1
1 56319
1 32897
1 69246
1 59111
1 5845
1 44069
1 44563
1 19533
1 31995
1 22157
1 13502
1 1307
1 42537
1 60784
1 40363
1 31983
1 23071
1 11304
1 48416
1 57872
1 13827
1 29632
1 60886
1 12738
1 59496
1 29988
1 7876
1 15279
1 26569
1 62592
1 22819
1 8963
1 7119
1 61345
1 37243
1 449
1 28767
1 5...

output:

178192

result:

ok single line: '178192'

Test #7:

score: 0
Accepted
time: 123ms
memory: 35008kb

input:

100000 1
1 52670
1 51157
1 66285
1 71477
1 43626
1 30699
1 4723
1 27122
1 21210
1 4707
1 58285
1 25305
1 55346
1 61958
1 60032
1 11283
1 65277
1 91648
1 79039
1 6055
1 18033
1 56975
1 52220
1 24114
1 97939
1 64658
1 13743
1 19269
1 77333
1 66756
1 64395
1 34692
1 72311
1 58534
1 27471
1 35410
1 6411...

output:

207612

result:

ok single line: '207612'

Subtask #3:

score: 9
Accepted

Test #8:

score: 9
Accepted
time: 51ms
memory: 20036kb

input:

5000 1
1342 1343
4110 4111
1415 1416
2960 2961
504 505
2756 2757
4496 4497
4178 4179
1933 1934
661 662
2894 2895
4041 4042
286 287
4881 4882
2988 2989
281 282
3038 3039
782 783
3878 3879
4914 4915
4578 4579
3877 3878
1870 1871
3014 3015
411 412
2711 2712
1479 1480
4818 4819
1930 1931
733 734
290 291...

output:

87526

result:

ok single line: '87526'

Test #9:

score: 0
Accepted
time: 49ms
memory: 20204kb

input:

5000 1
4605 4606
4467 4468
236 237
804 805
44 45
3706 3707
3222 3223
1600 1601
3132 3133
3201 3202
83 84
4075 4076
2487 2488
4100 4101
2709 2710
1564 1565
730 731
3934 3935
2859 2860
3382 3383
1490 1491
2915 2916
2921 2922
4292 4293
2149 2150
4866 4867
3894 3895
1499 1500
4826 4827
1389 1390
2565 25...

output:

-1

result:

ok single line: '-1'

Test #10:

score: 0
Accepted
time: 59ms
memory: 36964kb

input:

99000 1
79771 79772
79219 79220
95025 95026
74528 74529
74958 74959
60316 60317
89522 89523
50423 50424
18943 18944
95708 95709
85436 85437
89245 89246
88864 88865
45298 45299
80243 80244
45568 45569
86109 86110
88381 88382
40781 40782
80453 80454
74733 74734
83094 83095
38257 38258
87260 87261
9654...

output:

150655

result:

ok single line: '150655'

Test #11:

score: 0
Accepted
time: 160ms
memory: 36068kb

input:

90000 1
82770 82771
86846 86847
57191 57192
2404 2405
72238 72239
38989 38990
4520 4521
85621 85622
38425 38426
88887 88888
84483 84484
84979 84980
55756 55757
81666 81667
84172 84173
84048 84049
86248 86249
35519 35520
34092 34093
26006 26007
37509 37510
46515 46516
50285 50286
28067 28068
82609 82...

output:

224806

result:

ok single line: '224806'

Test #12:

score: 0
Accepted
time: 47ms
memory: 35104kb

input:

90000 1
45387 45388
59683 59684
54643 54644
48430 48431
46674 46675
75808 75809
83944 83945
37142 37143
7492 7493
35485 35486
13045 13046
77367 77368
89390 89391
53121 53122
81728 81729
64058 64059
64306 64307
82272 82273
44564 44565
87969 87970
81932 81933
63077 63078
30731 30732
41593 41594
77746 ...

output:

131664

result:

ok single line: '131664'

Subtask #4:

score: 16
Accepted

Test #13:

score: 16
Accepted
time: 77ms
memory: 21784kb

input:

20000 300
2298 16922
18552 10941
5144 7836
2466 9076
15500 13240
2610 15368
46 12878
8306 1607
9979 8975
2496 19531
11248 4651
4852 18243
7396 1470
7610 10848
10295 14356
4459 5642
4890 16696
3731 3723
762 4227
13780 8107
13906 2311
9823 2028
15526 1892
6024 10011
9630 9756
9126 15139
14648 115
9097...

output:

25404
25395
25396
25395
25399
25397
25400
25395
25402
25400
25400
25399
25396
25403
25396
25396
25396
25402
25397
25401
25405
25390
25403
25400
25398
25404
25403
25411
25403
25397
25405
25401
25393
25398
25404
25395
25397
25402
25403
25395
25403
25404
25397
25406
25398
25405
25391
25399
25403
25398
...

result:

ok 300 lines

Test #14:

score: 0
Accepted
time: 41ms
memory: 21596kb

input:

20000 200
9844 2753
14120 15267
6630 9346
16091 21
11589 11672
7243 10729
9376 18990
19172 16424
15329 4466
19473 2205
9722 13188
13805 12632
9639 7877
10960 12697
1725 10231
13383 4059
9258 10586
18536 11667
5581 666
1382 7072
17656 11359
10793 10158
18150 13161
9758 4811
280 4330
3962 17592
10138 ...

output:

23722
23666
23651
28090
23631
23485
23567
23595
23578
23603
23509
23666
23556
23615
23504
23487
23651
23615
23616
23613
23526
23655
23616
23684
23629
23465
23524
23669
23627
23672
23727
23677
23472
23744
23669
23705
23697
23675
23689
23632
23697
23568
23598
23628
23479
23699
23727
23717
23457
23632
...

result:

ok 200 lines

Test #15:

score: 0
Accepted
time: 24ms
memory: 21000kb

input:

20000 300
15900 13617
15456 4527
18252 8675
10038 17629
5790 15952
1128 19921
2934 14935
1038 12872
6767 16118
6828 9984
7945 15887
13998 7322
8995 13504
18230 11279
4385 2871
4201 18601
10337 9733
5597 6942
6198 11208
3858 5366
12618 1345
1765 4969
4744 707
6099 2958
526 2410
4693 18965
12076 14283...

output:

23450
-1
-1
-1
-1
23450
-1
23450
-1
23450
23450
-1
23450
23450
-1
-1
23450
-1
-1
-1
23450
23450
23450
23450
23450
-1
-1
23450
23450
-1
-1
23450
-1
-1
-1
-1
-1
23450
23450
-1
-1
-1
23450
23450
23450
23450
23450
23450
23450
23450
-1
23450
23450
-1
-1
-1
-1
23450
-1
-1
-1
23450
23450
23450
23450
-1
234...

result:

ok 300 lines

Test #16:

score: 0
Accepted
time: 12ms
memory: 20692kb

input:

19993 300
2068 11549
9404 8248
3492 9003
8571 10111
2309 11733
158 6219
2169 19021
6201 582
6942 7755
4438 5529
10945 10947
7085 12504
9811 17100
15357 5484
9625 8294
10097 5750
4515 16936
4233 9856
4473 14940
3098 1183
12486 1988
11402 3409
1495 10989
17785 6603
13719 11569
16461 1418
814 5856
1068...

output:

26862
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 300 lines

Test #17:

score: 0
Accepted
time: 13ms
memory: 22492kb

input:

20000 300
2298 16922
18552 10941
5144 7836
2466 9076
15500 13240
2610 15368
46 12878
8306 1607
9979 8975
2496 19531
11248 4651
4852 18243
7396 1470
7610 10848
10295 14356
4459 5642
4890 16696
3731 3723
762 4227
13780 8107
13906 2311
9823 2028
15526 1892
6024 10011
9630 9756
9126 15139
14648 115
9097...

output:

25005
25008
25008
-1
25007
25007
25009
25007
25009
25007
25009
25010
25010
25008
25008
25008
25009
25005
25009
25008
25008
25009
25009
25009
25007
25010
25007
25009
25008
25012
25007
25008
25010
25009
25009
25007
25010
25009
25008
25009
25011
25006
25011
25008
25009
25008
25005
25008
25008
25009
250...

result:

ok 300 lines

Test #18:

score: 0
Accepted
time: 58ms
memory: 21108kb

input:

19980 300
13644 3783
14514 4877
3225 15594
2582 17113
13741 17619
14222 7389
3209 16102
19 12366
12061 10261
4610 5352
10889 2548
3270 3438
9489 2705
13104 5732
12381 16499
4816 18174
11131 2012
6969 5399
18424 8587
18413 13161
9259 252
17255 9997
19017 16354
14120 9406
4592 13877
9090 1344
9771 809...

output:

26974
26936
27230
27167
26957
27174
26868
26996
27105
27268
27212
27252
27049
26917
27026
27256
26973
27481
27505
26970
27289
26482
27080
27196
27464
27338
27312
26875
26686
26833
26849
26931
27397
27239
27203
26768
27060
26865
26796
27161
27051
26882
27171
27234
27602
26661
27016
27447
26903
26967
...

result:

ok 300 lines

Subtask #5:

score: 0
Time Limit Exceeded

Test #19:

score: 0
Time Limit Exceeded

input:

65535 65535
1811 13118
468 385
23933 56882
4701 42452
49582 14109
22804 8146
20990 13165
2862 42235
19741 48554
50898 55957
62662 44085
48624 14885
7097 61368
19900 36151
553 50630
52087 31138
45875 33789
57834 46368
50259 10233
56656 29222
48661 58651
62042 50198
5077 28414
50381 15211
60800 37526
...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:


Subtask #6:

score: 0
Time Limit Exceeded

Test #24:

score: 0
Time Limit Exceeded

input:

100000 100000
48535 38306
85495 24582
10294 14137
41148 31842
32266 36977
2963 82055
78886 1396
81175 93259
80317 66239
83481 49641
35645 57424
97195 2160
53900 55968
4256 17352
95865 83196
64417 63683
64041 61292
3392 82881
22755 53454
71067 1268
2191 84847
66432 7544
15405 77351
50616 64123
97980 ...

output:

117138
-1
-1
117137
-1
-1
117136
-1
117143
117147
-1
117140
117137
117142
117141
117143
117143
117146
117141
117148
-1
-1
-1
-1
-1
117139
-1
-1
117136
117140
-1
117143
117139
-1
117138
117144
117139
117140
117142
117139
117137
117143
117140
117139
-1
117145
117139
-1
117138
117146
-1
117139
-1
-1
-1...

result:


Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

0%