QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#234920#2025. No Time to DryGMBox100 ✓69ms8772kbC++201.2kb2023-11-02 02:37:522023-11-02 02:37:52

詳細信息

Test #1:

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

input:

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

output:

2
3
3
3

result:

ok 4 lines

Test #2:

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

input:

100 100
2 2 1 2 2 1 1 1 1 1 1 1 1 2 2 1 2 2 1 2 1 1 2 2 1 2 2 2 1 2 2 2 1 1 2 2 1 2 1 1 2 2 2 2 1 1 2 2 2 1 1 1 2 1 2 1 1 2 1 1 2 2 2 1 2 1 1 1 2 1 2 1 1 2 1 1 2 2 1 2 1 2 2 1 2 1 2 2 1 1 2 1 1 2 2 1 2 2 2 2
26 84
25 62
2 56
37 42
16 84
7 83
39 97
51 79
27 53
23 57
1 4
16 57
29 59
28 84
58 69
10 35
...

output:

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

result:

ok 100 lines

Test #3:

score: 5
Accepted
time: 2ms
memory: 5968kb

input:

5000 5000
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 10...

output:

273
2069
1929
412
1718
516
1687
2429
1471
509
422
631
1458
994
1673
343
305
1254
1284
1150
645
1826
2567
381
1929
2907
1081
2113
1582
1446
7
2721
416
1869
1251
1714
994
730
410
2279
974
675
1738
835
1552
1450
2367
1023
1926
377
1741
27
776
186
1324
1140
2307
1268
1359
2426
2162
869
2236
996
442
1139...

result:

ok 5000 lines

Test #4:

score: 5
Accepted
time: 2ms
memory: 6000kb

input:

5000 5000
4178 4269 1525 278 3137 186 4958 2684 4346 3163 4931 4063 4816 4859 1259 2676 4756 1978 708 4346 3212 3509 3297 2721 1363 1224 132 3200 3275 1792 2174 2673 4651 4689 3919 4610 1116 2314 2551 2052 226 4514 2745 3544 3474 3256 2505 4056 1521 3456 864 1345 4958 4094 2465 3970 3605 3582 2139 2...

output:

3886
1075
2910
531
591
1701
950
3212
2635
4408
844
174
1432
4237
1027
2286
3276
3233
1596
755
3398
1531
58
332
158
66
48
2934
1017
3738
966
1037
1350
1419
3511
2636
744
337
153
269
1313
891
1527
1502
471
1499
431
491
1457
3204
1593
952
410
3415
782
3286
2531
249
817
1962
314
431
2572
427
1525
470
56...

result:

ok 5000 lines

Test #5:

score: 5
Accepted
time: 2ms
memory: 6232kb

input:

5000 5000
4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 4959 ...

output:

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

result:

ok 5000 lines

Test #6:

score: 5
Accepted
time: 59ms
memory: 8084kb

input:

200000 200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

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

result:

ok 200000 lines

Test #7:

score: 5
Accepted
time: 61ms
memory: 8244kb

input:

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

output:

24964
1033
43919
6400
23233
37790
49021
41773
26852
42519
75622
20600
14810
27328
16317
17663
6080
33682
49884
46518
83493
10718
26817
16171
48468
50941
27982
249
5908
31069
20857
1846
1804
29810
46882
53756
22576
27298
8835
18215
17561
65440
51836
26009
30729
1187
13903
1797
36214
31265
73552
8891
...

result:

ok 200000 lines

Test #8:

score: 5
Accepted
time: 54ms
memory: 7792kb

input:

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

output:

21634
12535
28437
54594
10245
52410
50394
43401
115
96152
23950
21018
10875
42640
99642
18110
87435
32403
89460
15392
74143
41287
73890
63433
27134
41687
32996
41422
9384
12685
108364
28583
15934
25916
53944
1866
5714
36703
3259
32395
102258
3408
62491
20396
7491
9532
40552
80191
71982
39492
42389
8...

result:

ok 200000 lines

Test #9:

score: 5
Accepted
time: 64ms
memory: 8092kb

input:

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

output:

18683
1628
3341
129949
63000
99213
100831
21804
24821
131870
85820
22884
57131
16293
20370
20256
87468
13110
66395
68456
50811
88168
5420
85544
793
2173
112154
121388
83109
50651
5957
45134
126
47273
17984
9991
29074
28052
91275
18095
45430
46001
126416
73270
81537
61217
75491
3724
36253
28188
86741...

result:

ok 200000 lines

Test #10:

score: 5
Accepted
time: 65ms
memory: 8144kb

input:

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

output:

30500
75724
73089
703
126848
11240
16120
49182
69984
86466
54551
32504
95897
3867
44798
70419
53232
91149
21943
6612
78492
71517
22900
83546
120232
27713
31882
44928
2996
78198
98853
126497
57397
100368
38623
67706
34228
25343
49084
39118
16736
36100
15244
24420
38976
17800
2952
98048
67682
79202
22...

result:

ok 200000 lines

Test #11:

score: 5
Accepted
time: 66ms
memory: 8132kb

input:

200000 200000
100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040...

output:

54590
35784
3366
36244
117582
15915
65583
11943
80120
113146
54472
9939
50600
8379
5627
20704
35205
115173
66527
56400
47550
34045
20168
104366
49562
6145
43534
78760
72121
87812
22582
102378
19889
52245
7537
111242
10094
69830
1113
25643
3676
49553
75141
68649
76743
58114
97885
13485
2359
89327
437...

result:

ok 200000 lines

Test #12:

score: 5
Accepted
time: 65ms
memory: 8044kb

input:

200000 200000
100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040...

output:

30342
55689
4745
30508
74673
52323
29642
69697
40531
25932
1450
77633
31089
19595
87484
53663
42400
65818
35245
19203
130626
22744
48709
44040
76298
60629
74104
32127
67045
56293
52439
75923
1388
2025
59061
30495
10615
11374
16109
45801
18609
27233
20226
7121
30495
91758
79419
99981
105149
104709
31...

result:

ok 200000 lines

Test #13:

score: 5
Accepted
time: 63ms
memory: 8364kb

input:

200000 200000
100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040...

output:

44307
63345
85750
46525
23000
71001
40742
20203
80351
55290
22772
36952
9088
6518
66121
5551
132674
77916
19174
54284
3997
17242
81445
41814
67221
14564
35730
36973
18101
18798
36391
33717
38641
56245
63304
68014
22833
21423
11595
51082
9080
31323
5707
5000
97161
122009
57688
127495
83044
13706
1293...

result:

ok 200000 lines

Test #14:

score: 5
Accepted
time: 63ms
memory: 8264kb

input:

200000 200000
100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040...

output:

68073
22111
51604
2747
61333
40964
43778
3291
58165
54920
55142
55162
7271
77468
15980
44847
27332
34637
3175
48678
80444
84485
95426
45070
27179
30615
4274
12426
21849
2138
94485
41089
65796
53189
88379
57095
98220
17020
17866
2959
50107
35168
67711
48264
30035
22628
72654
16834
17906
76889
36439
1...

result:

ok 200000 lines

Test #15:

score: 5
Accepted
time: 62ms
memory: 8520kb

input:

200000 200000
100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040...

output:

16971
46429
41296
50278
47664
27504
62285
363
17400
13395
31413
83034
14356
25010
43860
104492
8642
1325
83631
12015
5252
36452
130671
78658
9300
6336
976
66585
26900
86518
63094
37744
83456
88760
14611
105441
36905
8677
14207
113455
53483
11148
77996
90874
65244
29956
65992
44847
5208
124543
76764
...

result:

ok 200000 lines

Test #16:

score: 5
Accepted
time: 63ms
memory: 8064kb

input:

200000 200000
100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040...

output:

2317
105533
42641
56420
72368
66014
50415
56932
79820
84388
6973
36405
47799
47755
9110
94863
34254
81532
39166
82560
62756
46010
66090
5090
14704
81848
120723
49495
67488
36870
34063
4324
14937
37454
14330
53900
77642
92042
46097
52901
38738
48596
26884
42303
77734
13364
63883
107779
37779
33690
61...

result:

ok 200000 lines

Test #17:

score: 5
Accepted
time: 65ms
memory: 8208kb

input:

200000 200000
100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040...

output:

82399
359
6752
53321
81212
25598
13013
42251
47434
20313
46036
96550
22449
16379
26795
46424
68939
17387
40463
20377
13843
51473
49730
69040
79716
31067
9021
13616
33461
19139
34678
75656
39645
58849
54858
40307
13832
5064
60120
33648
66425
48532
73494
37714
36213
30336
56106
32205
33052
42675
43842...

result:

ok 200000 lines

Test #18:

score: 5
Accepted
time: 64ms
memory: 7884kb

input:

200000 200000
100000 100000 100000 100000 100000 99999 99999 99999 99998 99999 100000 100000 100001 100002 100001 100002 100003 100003 100004 100003 100004 100005 100006 100006 100005 100005 100006 100007 100008 100009 100010 100010 100009 100008 100009 100010 100010 100011 100010 100010 100010 1000...

output:

32222
17674
11961
29365
1865
42520
19245
7671
58060
12908
23963
32139
11775
51096
43918
14259
50775
29768
635
32148
23844
20008
42690
3817
10931
15210
23361
16741
7151
41823
13169
4489
34698
49098
6463
11344
1387
15309
47697
45302
25638
44778
30137
34630
36279
33833
3933
16378
31981
41993
7646
56065...

result:

ok 200000 lines

Test #19:

score: 5
Accepted
time: 66ms
memory: 8772kb

input:

200000 200000
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 9...

output:

43197
75667
78110
8800
77427
17296
99122
37271
46934
10193
54516
62916
87990
15849
99499
55871
36528
45673
23294
6722
61368
31211
49875
73961
15695
41560
28657
58996
3073
24507
97511
21013
31111
89869
49736
59908
85026
94508
35616
32841
52536
31652
70793
3063
44572
91349
64024
45456
88601
88812
3892...

result:

ok 200000 lines

Test #20:

score: 5
Accepted
time: 69ms
memory: 8336kb

input:

200000 200000
32545 127491 172173 46001 77560 107670 106213 42189 62595 151794 31324 36185 41047 26712 121549 52363 45228 128238 40987 96220 126712 152938 21867 54543 50451 107900 73644 108530 198625 195236 69570 70746 125690 63142 104291 183463 94196 162164 128005 98763 183296 63622 81690 4332 1694...

output:

38757
50193
13598
54637
33896
65644
54583
53912
31557
69200
30875
46662
98327
63401
154241
77601
74905
63610
27124
131401
36597
7962
43365
25698
17635
65407
51993
87509
127255
4846
42024
7386
18313
99929
78351
126148
185253
117912
40830
146238
11145
135763
13756
103741
1643
91028
20726
55883
107162
...

result:

ok 200000 lines