QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#116060#5280. Depot RearrangementDianasDog#100 ✓37ms44280kbC++141.8kb2023-06-28 08:45:112024-05-31 14:20:09

详细

Test #1:

score: 5
Accepted
time: 0ms
memory: 17716kb

input:

10 3
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3


output:

0

result:

ok both subtasks are correct!

Test #2:

score: 5
Accepted
time: 4ms
memory: 18916kb

input:

5 4
1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4


output:

13
1 21
17 1
11 17
18 11
6 18
13 6
7 13
19 7
2 19
14 2
3 14
9 3
21 9

result:

ok both subtasks are correct!

Test #3:

score: 5
Accepted
time: 0ms
memory: 19376kb

input:

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


output:

32
4 101
85 4
21 85
92 21
51 92
78 51
42 78
95 42
54 95
44 54
26 44
82 26
96 82
63 96
72 63
31 72
65 31
52 65
23 52
86 23
24 86
12 24
41 12
75 41
46 75
32 46
11 32
2 11
13 2
34 13
25 34
101 25

result:

ok both subtasks are correct!

Test #4:

score: 5
Accepted
time: 0ms
memory: 19312kb

input:

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

output:

19
101 1001
451 101
183 451
812 183
942 812
352 942
772 352
665 772
825 665
172 825
202 172
844 202
733 844
711 733
811 711
1001 811
706 1001
746 706
1001 746

result:

ok both subtasks are correct!

Test #5:

score: 5
Accepted
time: 5ms
memory: 18464kb

input:

200 100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

195
227 20001
16148 227
16830 16148
6329 16830
17201 6329
15517 17201
16308 15517
18908 16308
7034 18908
17734 7034
9974 17734
18894 9974
19114 18894
19632 19114
4443 19632
18934 4443
18766 18934
10366 18766
18441 10366
18071 18441
18471 18071
10476 18471
18476 10476
2841 18476
17217 2841
19501 1721...

result:

ok both subtasks are correct!

Test #6:

score: 5
Accepted
time: 0ms
memory: 17880kb

input:

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

output:

1401
3 4021
3867 3
4007 3867
3984 4007
4004 3984
3988 4004
3924 3988
3964 3924
3911 3964
3963 3911
3938 3963
3913 3938
3990 3913
3827 3990
3884 3827
3905 3884
3943 3905
3792 3943
3908 3792
3983 3908
3970 3983
3823 3970
3794 3823
3973 3794
3747 3973
3922 3747
3870 3922
3741 3870
3784 3741
3725 3784
3...

result:

ok both subtasks are correct!

Test #7:

score: 5
Accepted
time: 7ms
memory: 18800kb

input:

300 300
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

205
1227 90001
72627 1227
75609 72627
36905 75609
87605 36905
84677 87605
35604 84677
60536 35604
87053 60536
88566 87053
5704 88566
40289 5704
69707 40289
15407 69707
49635 15407
15435 49635
5789 15435
16204 5789
22204 16204
80115 22204
22215 80115
88504 22215
19866 88504
79950 19866
66319 79950
81...

result:

ok both subtasks are correct!

Test #8:

score: 5
Accepted
time: 6ms
memory: 21032kb

input:

301 40
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 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...

output:

11624
1 12041
12001 1
11681 12001
11961 11681
11641 11961
11921 11641
11601 11921
11881 11601
11561 11881
11841 11561
11521 11841
11801 11521
11481 11801
11761 11481
11441 11761
12002 11441
11361 12002
11439 11361
11962 11439
11362 11962
11922 11362
11321 11922
11882 11321
11281 11882
11842 11281
11...

result:

ok both subtasks are correct!

Test #9:

score: 5
Accepted
time: 0ms
memory: 24044kb

input:

400 100
11 65 1 79 15 18 79 46 9 30 71 53 58 55 94 73 39 16 6 91 49 30 23 30 28 81 90 48 97 54 79 30 94 18 42 77 44 36 5 48 55 97 79 36 41 59 79 71 32 59 3 10 63 52 44 41 9 46 31 31 56 87 60 80 12 51 15 78 41 65 95 34 29 83 46 64 37 53 98 17 41 45 36 73 20 53 48 80 57 54 57 72 39 56 98 6 10 78 11 72...

output:

14592
19 40001
39611 19
39918 39611
39522 39918
39934 39522
39626 39934
39308 39626
39770 39308
39227 39770
39952 39227
39156 39952
39415 39156
39230 39415
38962 39230
39797 38962
39541 39797
39631 39541
38524 39631
39958 38524
39421 39958
39020 39421
39928 39020
39007 39928
39843 39007
39037 39843
...

result:

ok both subtasks are correct!

Test #10:

score: 5
Accepted
time: 0ms
memory: 19600kb

input:

40 160
17 2 3 4 5 6 7 91 9 10 154 12 103 14 15 16 17 25 19 58 21 8 23 24 52 26 27 58 120 105 50 55 104 32 35 36 37 38 45 10 41 42 43 44 45 71 47 48 49 34 140 52 53 54 115 44 28 58 59 60 61 62 63 64 132 66 67 68 69 70 71 69 24 74 75 76 77 133 79 80 81 82 100 84 31 86 87 88 100 90 91 92 93 94 95 96 97...

output:

1316
9 6401
5420 9
5597 5420
6109 5597
6313 6109
5456 6313
5849 5456
6193 5849
4728 6193
5824 4728
4567 5824
5026 4567
2902 5026
5732 2902
5776 5732
4146 5776
5433 4146
3715 5433
5435 3715
6353 5435
5355 6353
2790 5355
4531 2790
4857 4531
5924 4857
4758 5924
3254 4758
5303 3254
4027 5303
4997 4027
5...

result:

ok both subtasks are correct!

Test #11:

score: 5
Accepted
time: 0ms
memory: 23352kb

input:

400 100
88 82 9 2 90 1 83 32 32 79 8 79 63 67 85 82 50 63 69 2 7 91 21 90 69 3 39 78 66 83 96 53 24 65 56 63 90 54 35 55 94 22 76 12 54 55 5 49 91 73 8 19 64 54 39 23 13 27 34 4 81 52 13 11 36 45 3 50 82 81 42 50 75 15 99 70 29 26 70 66 34 15 42 83 16 19 19 12 76 1 68 49 7 17 64 37 98 34 99 37 34 64...

output:

14611
6 40001
39742 6
39832 39742
39706 39832
39902 39706
39647 39902
39911 39647
39714 39911
39624 39714
39939 39624
39709 39939
39916 39709
39560 39916
39627 39560
39205 39627
39639 39205
39992 39639
39349 39992
39514 39349
38906 39514
39519 38906
38587 39519
39537 38587
39932 39537
39625 39932
39...

result:

ok both subtasks are correct!

Test #12:

score: 5
Accepted
time: 4ms
memory: 19264kb

input:

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

output:

4260
2 6021
6001 2
5681 6001
5961 5681
5661 5961
5941 5661
5641 5941
5921 5641
5621 5921
5901 5621
5602 5901
5881 5602
5582 5881
5861 5582
5561 5861
5802 5561
5541 5802
5781 5541
5521 5781
5741 5521
5461 5741
6002 5461
5381 6002
5421 5381
5981 5421
5361 5981
5419 5361
5962 5419
5382 5962
5944 5382
5...

result:

ok both subtasks are correct!

Test #13:

score: 5
Accepted
time: 13ms
memory: 26572kb

input:

300 300
215 159 263 206 201 183 286 56 142 10 231 214 34 54 263 250 169 208 239 148 104 22 244 17 74 68 184 52 2 30 42 83 222 106 25 152 37 225 213 213 69 273 91 221 207 48 166 28 221 50 46 64 10 254 207 109 206 144 270 291 195 197 253 235 141 186 102 68 52 24 38 6 181 44 256 200 77 233 285 163 223 ...

output:

32648
72 90001
89463 72
89203 89463
89789 89203
88669 89789
89823 88669
89642 89823
86504 89642
89449 86504
89834 89449
89238 89834
87828 89238
88114 87828
88682 88114
89412 88682
87927 89412
89492 87927
88874 89492
89546 88874
88626 89546
86421 88626
89254 86421
88628 89254
88312 88628
89622 88312
...

result:

ok both subtasks are correct!

Test #14:

score: 5
Accepted
time: 24ms
memory: 34864kb

input:

201 400
1 1 1 1 1 152 1 1 1 1 1 1 1 33 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 300 154 1 1 147 1 1 1 383 186 1 1 90 256 1 1 1 1 1 1 1 63 1 1 1 1 208 1 1 1 1 31 1 1 1 1 1 1 1 127 1 1 29 216 397 393 1 1 1 1 1 1 279 1 1 1 1 55 1 1 215 249 1 1 1 1 1 1 172 1 1 1 1 1 1 1 1 1 1 1 1 349 1 331 1 1 1 1 1 1 1 34...

output:

63990
1 80401
80201 1
79798 80201
79035 79798
79437 79035
78542 79437
79195 78542
79747 79195
78391 79747
79999 78391
80202 79999
78793 80202
79597 78793
78392 79597
79196 78392
80203 79196
77989 80203
79599 77989
79799 79599
78794 79799
80204 78794
79397 80204
78795 79397
77990 78795
79198 77990
78...

result:

ok both subtasks are correct!

Test #15:

score: 5
Accepted
time: 10ms
memory: 23032kb

input:

400 400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

217
632 160001
118632 632
160001 118632
2917 160001
147420 2917
133336 147420
87309 133336
132079 87309
148530 132079
134834 148530
126834 134834
143634 126834
110034 143634
119730 110034
53830 119730
117030 53830
139314 117030
137965 139314
152514 137965
133714 152514
34012 133714
83046 34012
34246...

result:

ok both subtasks are correct!

Test #16:

score: 5
Accepted
time: 10ms
memory: 23892kb

input:

301 200
50 129 146 60 183 51 47 77 26 73 1 45 1 44 149 1 81 196 17 16 163 35 159 71 1 94 161 138 138 27 76 1 102 42 5 186 176 1 111 198 37 63 81 155 95 164 132 135 155 194 126 98 31 34 121 19 175 148 33 105 25 122 91 165 1 69 1 197 12 98 1 155 5 53 42 1 60 98 78 61 155 13 1 171 102 152 95 61 87 200 ...

output:

23506
11 60201
56890 11
58255 56890
59601 58255
59403 59601
59604 59403
60008 59604
58824 60008
59611 58824
58696 59611
59317 58696
59915 59317
58273 59915
58826 58273
58128 58826
58833 58128
57153 58833
59058 57153
56493 59058
59618 56493
58208 59618
59208 58208
56004 59208
58033 56004
59014 58033
...

result:

ok both subtasks are correct!

Test #17:

score: 5
Accepted
time: 26ms
memory: 35192kb

input:

201 400
1 1 1 1 1 1 1 1 1 1 1 1 1 263 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 246 1 1 1 1 1 1 1 1 1 1 1 1 1 1 107 1 1 1 1 1 1 1 1 57 1 1 1 1 1 1 1 224 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 90 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 ...

output:

77869
1 80401
80200 1
79597 80200
78549 79597
79598 78549
79999 79598
80201 79999
78391 80201
79599 78391
80202 79599
79798 80202
78392 79798
78793 78392
80203 78793
79396 80203
79799 79396
79397 79799
78393 79397
80205 78393
77989 80205
80206 77989
77587 80206
80207 77587
77185 80207
80208 77185
76...

result:

ok both subtasks are correct!

Test #18:

score: 5
Accepted
time: 15ms
memory: 28512kb

input:

400 300
75 26 289 176 131 196 124 8 230 157 247 265 13 2 210 141 17 200 187 83 21 22 118 144 232 26 284 75 48 30 132 32 65 34 72 36 73 286 164 40 41 261 65 270 221 12 139 48 49 143 91 39 17 258 275 56 151 194 282 55 228 266 296 64 22 232 67 142 69 152 10 102 109 45 75 49 283 112 78 283 81 236 169 22...

output:

43105
14 120001
118579 14
118231 118579
118840 118231
115845 118840
117699 115845
118581 117699
118085 118581
119427 118085
118262 119427
114522 118262
117032 114522
113448 117032
117168 113448
116258 117168
119796 116258
117140 119796
113112 117140
115710 113112
116771 115710
116334 116771
112383 1...

result:

ok both subtasks are correct!

Test #19:

score: 5
Accepted
time: 37ms
memory: 44280kb

input:

333 399
1 1 1 1 1 1 1 28 1 1 1 1 1 1 161 1 17 1 1 1 1 262 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 43 1 1 1 1 1 70 1 1 1 142 1 1 1 1 1 1 1 1 1 1 1 1 70 1 1 1 1 1 1 278 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 245 1 1 1 1 1 1 33 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 106 1 1 1 1 268 1 1 1 172 1 1 1 1 1 312 1 286 1 1 1 1 ...

output:

114795
1 132868
132535 1
131537 132535
132202 131537
132536 132202
131869 132536
132538 131869
131203 132538
132203 131203
131539 132203
132539 131539
130870 132539
132205 130870
130204 132205
132206 130204
131204 132206
131540 131204
131870 131540
131206 131870
132540 131206
129871 132540
132208 12...

result:

ok both subtasks are correct!

Test #20:

score: 5
Accepted
time: 21ms
memory: 31348kb

input:

400 400
100 35 353 385 317 228 7 148 113 165 11 306 209 89 21 166 17 2 19 249 27 305 377 22 3 353 38 28 29 96 191 32 33 309 35 308 100 176 152 40 176 42 43 86 45 46 96 48 396 381 218 246 53 54 334 159 243 360 294 60 33 62 185 64 65 66 191 121 351 107 10 343 367 74 75 201 77 247 79 134 304 92 42 126 ...

output:

55816
18 160001
153298 18
158949 153298
159605 158949
157641 159605
158586 157641
159997 158586
158108 159997
158420 158108
158076 158420
159208 158076
155253 159208
156043 155253
158598 156043
154460 158598
159214 154460
154904 159214
156434 154904
159024 156434
159935 159024
156187 159935
155762 1...

result:

ok both subtasks are correct!