QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#833691#52. Debug3un_larryfunc100 ✓162ms15564kbC++14655b2024-12-26 23:34:202024-12-26 23:34:21

詳細信息


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 1ms
memory: 5900kb

input:

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

output:

12
9
4
9
15
23
16
9
8
8
5
3
7
2
9
7
4
7
14
21
5
5
28
20
5
17
5
16
8
4
16
26
15
21
7
8
8
13
3
16
18
21
16
16
5
16
15
12
18
5
14
7
2
3
11
4
6
9
9
16
13
21
11
2
3
12
12
8
19
18
21
16
8
6
10
19
11
7
18
12
6
26
9
11
15
14
1
16
7
21
5
9
14
5
20
14
3
8
7
8

result:

ok 100 lines

Test #2:

score: 10
Accepted
time: 1ms
memory: 5896kb

input:

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

output:

146
167
106
169
197
117
317
110
191
77
106
183
176
157
244
160
147
65
334
63
106
91
106
91
260
45
426
325
13
23
120
73
220
56
13
321
36
28
243
277
191
90
91
247
390
18
89
338
432
31
117
117
198
56
205
22
16
158
472
304
208
201
75
340
65
32
368
179
183
60
220
72
290
6
107
45
172
31
81
28
415
311
57
4...

result:

ok 1000 lines

Test #3:

score: 10
Accepted
time: 1ms
memory: 5968kb

input:

10000 2412
613 1405 379 143 707 1588 1304 2028 436 249 2274 1678 767 828 1306 1099 123 1043 2179 535 1469 1556 1092 2163 2152 981 396 1599 590 478 456 2279 417 604 1845 1019 661 272 779 377 1857 2228 782 1075 225 2031 1495 1272 2356 1596 345 2380 954 313 1924 1828 1807 1098 1038 363 1941 1331 787 96...

output:

6514
39286
50703
58181
55137
25274
3027
46870
11004
29244

result:

ok 10 lines

Test #4:

score: 10
Accepted
time: 131ms
memory: 14116kb

input:

1000000 100000
26295 72296 31164 47954 65631 38491 70897 7603 97034 7626 5822 45374 70121 80791 29693 98826 72925 17412 99378 19355 53867 2722 48363 2330 95440 76349 96914 68773 55568 50096 18289 68910 18671 10919 48162 63172 75294 2251 33180 40137 40132 37811 59342 37326 2069 34213 13865 89094 7301...

output:

1389765
7734779
6507532
196584
7088154
891057
1393961
3608747
5313866
1250990
4136122
11158662
2208648
5783228
154544
1844948
5656644
1108273
577856
2150
3224058
10138532
109288
267876
4561576
8030165
2864131
4147187
7300198
1217874
609704
2769059
2779382
6106825
4425035
53893
1601104
3258813
612837...

result:

ok 1000000 lines

Test #5:

score: 10
Accepted
time: 27ms
memory: 15476kb

input:

1000000 10000
67355 2 669126 3 298230 433741 635282 1 3 2 2 3 3 2 545410 799425 417884 22120 899350 822980 2 2 674173 848382 3 851718 27753 655260 2 735544 1639 1 201902 1 2 410581 513533 956919 70600 405014 3 1 2 355744 470395 3 233931 3 1 578720 1 335836 1 3 3 789795 278332 3 2 273862 821677 59497...

output:

932037073
1390750189
529175761
1998191547
1216014553
1122184948
2302665235
1821311776
333155973
802542805
2972313626
1920584409
44933804
1554075082
1163890479
963865818
1895891517
1990313605
247542679
2011021630
2225305316
1428768417
2899855399
701228808
581929738
1987737461
1334534150
1193386643
21...

result:

ok 100 lines

Test #6:

score: 10
Accepted
time: 162ms
memory: 15564kb

input:

1000000 1000000
429864 1 193453 447524 3 1 3 3 372685 630814 337098 378822 340625 388081 2 1 2 721126 604893 826320 3 3 782419 43330 2 536994 341413 2 2 690634 1 1 2 702223 3 415163 1 1 2 277503 477432 302417 3 753327 799113 912993 3 3 725741 292978 254128 840880 2 1 821185 253888 944491 200183 9169...

output:

40826370381
6024758285
129877763494
177246455282
95498887755
209700002739
67961562919
145789246305
197136725657
292521668
112956678238
121555320424
153726121616
194161236137
132053700543
22553662957
48504646822
113927965890
218676164928
198834393811
112023434571
62323290169
49423541341
5793422299
77...

result:

ok 1000000 lines

Test #7:

score: 10
Accepted
time: 125ms
memory: 15204kb

input:

1000000 50
513076 2 2 684933 1 3 1 155709 3 2 3 911002 853615 2 3 2 3 2 3 2 1 1 1 2 321636 487279 161582 2 3 563180 134608 336524 2 236107 660724 233423 455812 3 694838 3 1 3 921743 1 464384 33080 686439 2 501436 583977
1000000
378531 555916
68764 483058
112823 180622
129874 348574
207090 691811
373...

output:

2808631
6559701
1073505
3462785
7674807
8288379
10141310
8885021
1309040
9205169
8295581
617020
8181040
2995693
2803935
1253809
4376288
209054
50220
12460623
7648701
106590
12068963
14475286
9472085
6965845
273963
4156219
4345436
4381251
5824896
730414
3145580
851923
11623559
2253027
2658146
1580978...

result:

ok 1000000 lines

Test #8:

score: 10
Accepted
time: 8ms
memory: 8200kb

input:

100000 100000
1 2 1 1 3 3 3 1 3 1 1 3 1 1 2 1 1 3 3 2 3 3 3 2 2 3 3 3 2 2 2 3 3 1 3 1 1 2 2 2 3 1 1 1 2 1 3 2 3 2 2 3 3 3 1 1 1 2 1 2 3 2 3 1 3 2 1 2 3 1 2 1 2 3 3 3 2 3 3 1 2 1 1 2 1 2 1 3 2 2 1 1 3 3 1 1 1 3 2 2 1 3 2 1 3 3 1 2 3 2 1 2 2 2 1 1 1 1 1 2 2 2 1 2 1 3 2 1 1 3 1 3 3 1 1 2 2 3 3 3 1 3 3 ...

output:

2641430443
724078274
4972080603
1325852846
1171759466
2538546263
1429834020
2670792497
4192503769
1839840337
2586430380
3498951480
250293520
725607866
2982869309
2087706114
3640674931
4404955477
1403132080
536965040
613180343
3457851403
3901908323
2622309883
1349462420
500220914
1199392620
223006100...

result:

ok 100000 lines

Test #9:

score: 10
Accepted
time: 13ms
memory: 6588kb

input:

100000 100000
57554 481 50839 28767 95369 90126 87978 92396 86982 51330 82883 71521 56932 11323 27254 40358 63965 21947 87339 92210 42531 55688 44715 65354 41922 96095 96745 41904 89543 84735 3497 11548 80223 37408 71508 17358 63443 90637 75695 27545 64492 19307 56772 72006 15095 67083 2621 31594 12...

output:

60699
553107
349928
802236
343673
275854
33189
520571
585595
738063
489352
347806
136403
42496
437171
279352
326296
565720
550471
693847
411134
664709
550281
5627
1166457
298277
282398
723188
519959
334010
161830
84333
162087
622246
721019
100397
496750
101166
910011
170240
413387
160838
762186
1773...

result:

ok 100000 lines

Test #10:

score: 10
Accepted
time: 161ms
memory: 15564kb

input:

1000000 1000000
849596 681686 450518 301079 914904 619982 651479 813637 750781 527715 728925 344093 266922 957948 42541 155900 521643 986972 481474 577940 954846 544687 416344 89229 304456 882433 554189 414445 324625 369118 371819 791142 765486 45874 714434 462184 249971 590341 940015 867253 998708 ...

output:

2239650
1986858
591185
1200366
13538313
7741575
4526466
10229970
2436020
8753057
4285773
6367650
5199820
3707435
10129183
1603906
11808953
806655
6002140
3639035
7965358
3691080
10305980
806238
9985557
9661027
5056470
3175405
9416167
2656698
10332825
222484
7697781
1450577
3323958
8476459
8379805
45...

result:

ok 1000000 lines