QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#23592#3264. 相逢是问候flower95 3794ms17520kbC++203.4kb2022-03-17 22:42:472022-04-30 03:36:52

詳細信息

Test #1:

score: 5
Accepted
time: 3233ms
memory: 17252kb

input:

45584 41916 59814720 51285695
45912706 10630744 27740926 16458675 35721023 54916324 21588702 8075160 8644669 2651528 8548247 13918903 38922864 22389520 13561070 28812648 41064507 39553490 55456972 25606040 1843348 10221258 11520360 31233313 27630240 52329802 40048051 29301841 12171226 14518046 19562...

output:

42362247
34868238
34315005
12103369
15434060
5228225
18448303
22390504
33380417
26083485
15787123
47149364
40022195
4269481
57803029
5040636
45866852
18707692
27779046
47083187
32812873
19965867
40284855
34206553
46329883
24861319
59329109
50032126
6466299
18029829
37085526
1619053
33586367
3043363
...

result:

ok 41916 lines

Test #2:

score: 5
Accepted
time: 1378ms
memory: 11944kb

input:

22995 22376 2544509 416331
1176594 1050747 1875958 2397774 379394 352061 1063481 39898 840406 2176353 190864 163298 1818339 1586740 1589287 1805147 2426624 2056738 304774 203687 1306667 1261985 26621 1166780 1297450 2540811 2360217 697857 2307111 2092547 1808769 184066 1751678 2372887 815653 1557313...

output:

2038157
2459643
380272
244963
1669682
2540880
1937911
899415
1526195
249988
358332
1549043
566322
1904122
1047076
210615
247553
1370120
1083831
143663
2180347
1072062
936539
1352880
262012
177922
2435486
414937
2056937
1205429
284829
2102085
2044451
2444889
827921
2311776
1904272
1335586
274956
1872...

result:

ok 22376 lines

Test #3:

score: 0
Time Limit Exceeded

input:

49866 46473 56351508 7624655
26761759 16685195 55970128 16849112 1591188 42969608 7299159 41900772 51513027 25996444 21686031 33143134 30769105 35951652 7642651 36244222 38488869 14612492 10678690 34699745 46605564 27012335 52091910 49266524 23510586 1806815 5557244 10595252 39998591 43026071 843769...

output:


result:


Test #4:

score: 5
Accepted
time: 1247ms
memory: 12412kb

input:

21786 21359 9172957 5296419
7344030 5194814 775869 1485494 4118440 6062259 3345556 578443 4642879 1731073 7992559 2411206 4169048 2849184 7875222 5529115 6204495 6418145 8739485 5558460 581172 2313584 7235660 1581717 3540440 4821894 7176896 8246335 375392 1519824 8295840 4499362 463386 1646513 37253...

output:

8775264
2989682
4463342
7511423
4799896
6203385
3169563
3859629
700030
8959497
8776023
1291201
1354390
6437951
1101343
2810797
1612630
59734
2000776
7838070
5558357
3488654
2208790
2092777
7842331
8493213
4172651
8942746
8505224
2231012
8544081
8965217
1158771
6576854
9071103
7357669
4741912
6395018...

result:

ok 10777 lines

Test #5:

score: 5
Accepted
time: 2633ms
memory: 17192kb

input:

45653 41902 4855921 1516929
1864126 4848519 1738964 1684108 2951498 2481769 2192195 366663 243189 166942 1911910 3790775 317961 3577935 4132879 1906397 832219 1000149 1876696 1712377 1804779 4416901 1209666 2452851 1875347 4787361 2090422 2095533 4472601 4076543 2273567 3068870 1785684 2158991 44186...

output:

4086942
3996321
325476
3098607
1400981
2767738
2551826
721561
686526
1183295
4454167
767101
1614315
263442
2444619
3775866
4481567
4276352
1659900
659072
1908581
2861253
124950
2781694
3187901
3711446
2345836
3338889
1240565
604118
1454344
3162657
3611279
1317979
3104117
2957245
2653061
2079971
1029...

result:

ok 20929 lines

Test #6:

score: 5
Accepted
time: 1101ms
memory: 10404kb

input:

20440 22424 22087836 13788806
299852 3725954 18535134 10343492 2862529 15598416 6856415 14491334 6564398 7744792 9433529 16488700 3916706 11798221 8514408 19584552 9630801 10884385 10343712 20201076 15395616 5427021 13803053 6764330 9294436 3439835 10453996 3665941 7456784 10276346 6192321 5445905 2...

output:

967655
907661
18238287
18253167
21055876
3264392
14976188
9373754
19492254
20046556
17678434
15326289
14077108
6955504
6692653
3118641
3051925
18593341
12388843
6907357
4361382
19943482
19794068
16272641
20219922
21308576
5552021
17042958
13832466
14718470
7605758
2161924
22057074
182974
5981232
232...

result:

ok 11347 lines

Test #7:

score: 5
Accepted
time: 27ms
memory: 17236kb

input:

45135 47326 2 1
1 1 0 0 0 1 1 0 0 0 0 1 1 1 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
0
0
1
0
0
1
0
1
1
1
0
1
1
0
1
0
1
1
1
1
0
0
0
1
1
0
0
0
1
0
0
1
0
1
0
0
0
0
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
0
1
0
0
0
0
1
0
0
0
0
1
1
0
0
0
0
1
1
1
0
1
1
0
1
1
0
1
0
0
0
0
0
0
0
0
1
0
1
0
...

result:

ok 11328 lines

Test #9:

score: 5
Accepted
time: 38ms
memory: 16984kb

input:

40185 40441 3 2
0 2 0 1 2 1 2 2 0 1 2 1 1 1 2 0 1 0 2 0 1 2 0 2 0 1 1 2 0 2 2 2 1 2 1 2 0 0 2 1 0 0 2 2 1 2 2 1 2 1 0 2 0 0 2 2 2 2 1 2 0 1 0 2 2 0 1 1 1 1 1 0 2 1 0 1 1 2 0 0 2 0 2 2 1 2 2 0 1 1 2 2 1 1 0 1 2 1 0 2 0 2 0 0 0 1 1 1 1 2 1 1 0 2 1 2 1 2 1 0 2 2 0 2 1 2 1 1 2 2 2 0 1 2 0 1 2 0 2 1 0 2 ...

output:

0
1
0
2
0
0
0
0
0
1
0
1
1
1
2
2
0
0
2
2
1
1
2
0
1
1
2
2
2
0
2
2
2
1
0
2
1
0
0
0
0
2
1
0
1
1
0
1
2
1
0
0
0
2
0
1
2
2
0
0
2
2
1
1
0
0
0
2
2
1
2
1
0
1
0
2
0
1
0
0
2
0
1
0
1
0
0
0
1
1
0
1
0
1
0
1
0
0
2
0
1
0
2
0
0
0
1
0
0
2
2
2
1
2
0
2
1
2
1
1
2
2
2
0
0
1
2
2
2
0
0
0
1
2
1
2
0
0
2
0
0
1
2
0
1
2
0
2
0
2
...

result:

ok 20308 lines

Test #10:

score: 5
Accepted
time: 22ms
memory: 10624kb

input:

21254 20964 3 1
1 2 1 0 0 2 0 1 1 0 0 2 2 1 2 1 2 0 1 0 2 1 1 0 0 0 0 0 0 0 1 1 1 0 1 2 0 0 1 1 0 0 2 2 1 0 2 2 1 2 2 0 1 1 1 1 0 0 2 0 0 1 0 1 0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2
1
3
2
2
0
1
0
0
1
2
3
2
3
1
1
2
2
1
3
3
2
1
2
0
1
3
1
1
3
3
2
1
3
1
1
0
3
1
1
2
0
3
...

result:

ok 23559 lines

Test #12:

score: 5
Accepted
time: 16ms
memory: 12556kb

input:

21682 23277 4 3
2 3 0 2 1 2 2 0 3 2 0 3 3 1 3 2 0 1 2 0 1 2 3 3 0 1 1 3 3 2 1 0 0 1 1 1 0 2 2 2 1 3 1 1 0 1 1 0 0 1 2 0 2 2 3 0 1 1 2 2 2 0 2 2 1 0 3 2 2 2 1 2 1 2 1 2 3 3 0 0 1 2 3 0 1 3 2 1 1 1 1 2 2 0 3 1 0 3 0 3 3 1 3 1 1 2 3 3 3 2 2 3 1 2 2 1 1 0 3 1 1 0 0 1 0 0 1 1 0 1 3 0 3 0 2 2 3 1 3 2 0 1 ...

output:

2
0
2
2
0
3
3
1
3
2
0
1
3
2
2
2
2
2
2
2
2
0
0
3
3
3
0
2
0
0
2
2
1
0
0
1
1
0
1
2
1
3
2
2
0
2
0
1
0
0
0
0
1
3
2
3
1
2
3
2
1
0
1
2
3
3
1
1
0
3
2
3
0
1
1
2
3
0
2
3
0
1
0
3
1
3
3
3
0
0
2
1
0
1
1
2
2
3
0
0
0
2
1
2
3
3
3
1
2
0
0
1
0
0
1
2
1
1
0
0
0
0
2
2
0
1
1
1
2
3
0
2
0
0
0
1
2
0
1
3
3
0
3
0
0
3
2
2
1
2
...

result:

ok 11539 lines

Test #13:

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

input:

100 100 65395230 35881714
62142195 19706133 28647489 33450222 48824506 8015154 46541425 16938863 64792759 48227269 6896697 21723841 7041187 14950522 37810236 63082187 37644871 25289010 6995498 18738693 58887782 24150987 45707180 20433758 37690032 13107477 51913203 47307693 34043407 56946152 43712656...

output:

18389247
24237024
50091880
50924464
56946152
56785114
13826153
57752902
37221389
60909537
22970665
1652148
61467055
48535910
63412074
24875632
22195094
28180544
16268319
39914963
59603824
46691956
37349399
61510538
15959540
50964784
35129602
4781374
41586501
30074778
39377500
41405873
50460526
57303...

result:

ok 52 lines

Test #14:

score: 5
Accepted
time: 9ms
memory: 5716kb

input:

100 100 12678909 7538356
2201473 5661370 2769279 10561937 7492323 1433421 9060089 12481348 9433373 8243661 10699475 7503539 9390548 7629765 5692055 11072808 3060561 11608574 979011 580858 10217189 8184373 4795988 12281050 12612416 10915825 1673084 10909889 10289444 63871 5649334 7362221 2974515 6552...

output:

8485943
518635
3950759
4890470
6858835
2493268
7852074
10333858
8933168
1336668
344752
5907004
4420428
2689985
1978148
1345229
1863827
6031349
10324669
6757399
9060089
8472665
5616992
11482421
384125
10043664
9070216
9871351
7733125
10003085
11116466
866474
3179010
1336668
12533322
5528477
2252643
1...

result:

ok 57 lines

Test #15:

score: 5
Accepted
time: 8ms
memory: 5624kb

input:

100 100 36605287 36140629
928163 757781 848266 35758454 11245332 25344601 13794272 11245874 10785090 14264236 22516152 30968187 29958405 23229254 15129551 2336761 8372745 24483921 21387830 14740458 36083451 18334210 29693065 8496923 36034359 899469 3451835 19794908 13109192 13471331 10571588 9426056...

output:

8592249
13034491
28244942
12929543
6747721
35874182
30417980
16503879
11854799
1687377
30017451
23806457
3516635
14720965
30486799
31850187
15230021
17972408
12927260
12735206
16456109
6444490
31100382
10628133
23711975
16609210
6153486
19926422
28791026
36083451
32274045
26443486
23065162
7162675
1...

result:

ok 49 lines

Test #16:

score: 5
Accepted
time: 8ms
memory: 5688kb

input:

100 100 47899891 45117151
15500708 3364986 30436889 4248 24233393 43480876 32962716 2575011 30076950 42729768 34711652 43877392 46696363 11004071 45766924 19172026 19310588 4920427 45418331 39857639 22432943 8555735 1072155 887503 14417379 9005106 3355397 23477839 43277886 9881889 40333676 19161021 ...

output:

40751939
47353718
38542758
35281512
22323601
21356240
12544663
1072155
9964582
38542758
14967331
24226138
22782095
6438590
30401051
23477839
7456462
40012848
39841088
45590039
46882618
13467248
15138159
19726711
37678710
15138159
42052066
17714786
43877392
28393517
44214212
27506775
38721187
9964582...

result:

ok 56 lines

Test #17:

score: 5
Accepted
time: 3285ms
memory: 17508kb

input:

44329 45755 68619429 6566086
843174 65229649 59125415 67821377 18689145 32418611 44992263 14973870 35070569 55503111 68255443 39631384 34675944 37469704 5042695 27118881 37925381 44788140 12166241 10168253 14558444 25523027 5622485 451693 54967664 4638370 23588770 43558745 7141255 15734195 16456462 ...

output:

59840104
67934869
58740502
63332121
43805399
39045266
24110708
45477132
55652306
15093485
50501371
62844526
39523938
14485425
2442556
20032230
67836923
59189027
36133336
16663700
37359343
19040252
43684134
4322000
18569155
32035907
5328503
30900740
58886072
62551108
64026612
11902692
15444142
267397...

result:

ok 22767 lines

Test #18:

score: 5
Accepted
time: 1659ms
memory: 14084kb

input:

22546 22419 78515632 36554488
63733797 51094082 72419096 41102325 50264394 26786070 6547265 50849474 41765297 71170341 32475658 59598617 43602737 35970848 21281454 53371590 70848844 25965861 22291904 46360888 76643665 62411638 65081324 18727899 18358254 1183723 75155597 54917759 11203300 1336991 354...

output:

71668064
77736829
58131546
54084631
47985479
3443344
27723760
22214992
45732270
1031733
6074656
13414795
74814000
14473328
75336688
20752194
57659993
22489819
40868064
60626304
8856592
22749328
62137616
41400368
11055632
72580944
46849280
39704512
76274272
21260800
20525088
3945632
78344640
43331434...

result:

ok 11294 lines

Test #19:

score: 5
Accepted
time: 3794ms
memory: 17520kb

input:

49162 41842 19949056 11777677
16867366 16906181 6606587 10031764 17987515 10305821 431586 1631720 9356732 4759175 529483 9879136 8727975 15639532 8175603 4200362 2924698 15351957 3082940 10200939 9486171 15668947 16369937 13326017 5582879 7312405 18138571 10003496 6923706 8718438 17504387 622462 113...

output:

794086
7082217
6734670
6098741
15759886
10901085
11417030
9468409
16989236
18465551
18594207
18548271
16324216
18517647
18264622
5001030
4595041
5387361
10321114
7029013
8962215
15497519
922744
978672
16072126
3690976
10983878
4147190
621932
5411808
19054114
19783230
5599015
10675464
11863292
1179
9...

result:

ok 20967 lines

Test #20:

score: 5
Accepted
time: 1107ms
memory: 12396kb

input:

22028 22371 6135536 508738
2937934 4141578 949738 3048488 4615707 964740 4457403 5571871 2559404 2086996 3402665 1274696 1421557 6098141 5218241 1511269 3234575 2746297 5212454 5216571 5364813 4782039 3292407 3143999 807305 4219491 4785536 625836 2552956 5611816 2745663 2144812 5314414 5548673 41201...

output:

2107923
5949237
381961
4430668
1709613
2321856
3082530
2148832
3731312
751328
2717030
5805648
2787344
4207136
1662976
2301088
5329472
1578864
1059136
781088
2685456
1603888
5305408
1566672
260512
2452800
5439600
2168784
273344
2691488
4509296
2008832
1843632
3574846
1590288
2011264
178592
2824016
56...

result:

ok 11115 lines