QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#809312#4246. Cactus is Moneyucup-team2172#AC ✓44ms31816kbC++234.3kb2024-12-11 14:10:312024-12-11 14:10:37

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 9884kb

input:

3 3
1 2 0 1000
2 3 0 1000
3 1 1 1

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 0
Accepted
time: 0ms
memory: 9884kb

input:

5 5
1 2 666 10
2 3 555 1000
3 1 444 345
1 4 222 234
2 5 333 123

output:

1185480

result:

ok 1 number(s): "1185480"

Test #3:

score: 0
Accepted
time: 2ms
memory: 10252kb

input:

5 6
1 3 12316 13729
1 2 171 10309
5 1 47389 7369
2 4 43318 36867
1 4 30728 43835
5 3 24437 31639

output:

6732185824

result:

ok 1 number(s): "6732185824"

Test #4:

score: 0
Accepted
time: 2ms
memory: 9888kb

input:

6 6
5 2 36032 49949
4 5 8963 9741
3 4 4004 35098
4 1 14459 30350
4 6 39612 8568
1 5 8645 16098

output:

11617618224

result:

ok 1 number(s): "11617618224"

Test #5:

score: 0
Accepted
time: 0ms
memory: 9772kb

input:

6 6
6 1 1516 16290
3 5 47834 15228
5 1 14795 44496
2 6 21296 36977
6 3 42659 16631
4 3 9808 31313

output:

13124412318

result:

ok 1 number(s): "13124412318"

Test #6:

score: 0
Accepted
time: 2ms
memory: 10176kb

input:

7 7
1 7 42781 13704
7 3 48779 17985
6 4 27969 24986
4 7 33333 35700
5 7 4859 49960
6 2 23927 33500
6 1 11232 15327

output:

24803495714

result:

ok 1 number(s): "24803495714"

Test #7:

score: 0
Accepted
time: 0ms
memory: 7908kb

input:

10 11
7 3 43798 8096
5 7 36600 4126
2 6 20599 15893
9 6 7541 5621
4 9 22047 10608
5 10 21235 2700
1 10 19260 8862
4 3 22407 37504
5 1 12867 1738
1 8 48480 15236
2 5 43525 13679

output:

19944198324

result:

ok 1 number(s): "19944198324"

Test #8:

score: 0
Accepted
time: 2ms
memory: 9896kb

input:

10 12
10 2 21765 14299
4 2 8316 29600
3 2 36018 33286
4 5 30741 46828
9 7 13354 18461
9 5 11896 14216
6 1 35705 34008
1 9 41496 21860
7 5 37709 34178
8 7 1595 27497
6 9 12139 37471
3 5 43310 12734

output:

39767313936

result:

ok 1 number(s): "39767313936"

Test #9:

score: 0
Accepted
time: 2ms
memory: 9964kb

input:

10 13
10 1 28967 29646
9 1 45852 47509
6 1 2590 36591
5 4 21715 40134
1 5 44167 42132
2 10 27289 12132
5 7 26720 1258
1 3 2762 28223
3 6 6966 48096
5 8 23536 33618
7 8 28326 9456
1 2 4885 15100
5 9 41414 32957

output:

43567826244

result:

ok 1 number(s): "43567826244"

Test #10:

score: 0
Accepted
time: 2ms
memory: 7848kb

input:

20 28
18 19 35583 99
15 18 30705 19256
14 18 20288 26882
18 4 39622 18793
11 7 47613 25425
8 18 33445 7046
18 13 37838 47190
18 1 47524 18152
8 10 20627 40858
18 6 49396 47654
9 18 9453 36001
20 18 33280 38985
11 18 47686 42244
1 20 8726 35210
14 6 20998 13452
18 10 10397 48525
19 4 45811 48722
5 17...

output:

196145757738

result:

ok 1 number(s): "196145757738"

Test #11:

score: 0
Accepted
time: 0ms
memory: 7904kb

input:

20 28
1 11 29270 12003
11 14 39731 27230
4 11 43657 44868
13 10 37887 17666
8 6 12758 4662
12 18 34016 15740
12 11 1123 44690
1 14 1866 31755
17 7 12441 26285
3 10 29159 11042
4 19 22612 12647
2 3 43899 27826
17 3 26727 7304
20 5 32807 49683
16 3 40800 14397
3 5 21244 13387
11 3 39919 35610
15 9 944...

output:

135255186000

result:

ok 1 number(s): "135255186000"

Test #12:

score: 0
Accepted
time: 0ms
memory: 10008kb

input:

500 627
218 441 9330 38888
394 403 39336 6683
81 319 10978 28288
157 204 27638 7127
58 38 7029 7446
168 100 23915 46064
180 151 42120 1549
18 238 15877 34786
37 259 37301 2159
463 185 4155 13849
77 355 5111 14848
62 486 19786 48858
132 408 41592 45835
245 378 46373 21496
291 20 36847 18682
435 213 3...

output:

115468900928208

result:

ok 1 number(s): "115468900928208"

Test #13:

score: 0
Accepted
time: 0ms
memory: 10032kb

input:

500 655
118 73 5102 36606
387 191 18264 17089
462 226 6016 40383
215 303 3543 6165
95 192 19518 19250
37 430 21505 26348
406 484 45283 8029
446 64 32626 30683
432 146 22720 12184
1 145 4822 43486
169 355 44960 12596
399 372 1339 28076
452 387 11774 33758
186 72 47444 20235
145 61 30207 39522
87 419 ...

output:

126690228324902

result:

ok 1 number(s): "126690228324902"

Test #14:

score: 0
Accepted
time: 0ms
memory: 9988kb

input:

500 499
11 127 37123 28858
439 253 39067 7779
148 142 5215 35775
441 354 15081 38415
145 463 8601 8508
400 332 23071 25635
193 124 33687 31694
154 449 45482 46872
499 469 49487 28780
24 246 48364 48917
458 397 3906 33392
130 108 13072 11058
235 406 11881 17681
20 172 35252 25687
81 24 41900 11751
49...

output:

159542365665488

result:

ok 1 number(s): "159542365665488"

Test #15:

score: 0
Accepted
time: 0ms
memory: 10000kb

input:

500 748
307 162 27455 28463
264 251 6256 153
393 228 41230 20255
251 213 27015 29368
60 446 39647 38740
335 462 29065 41130
347 310 37880 860
251 314 13609 26570
164 80 835 21262
164 216 460 5584
84 251 804 1471
455 293 7746 17437
164 496 37793 9885
164 287 31791 14404
164 94 33272 27145
164 395 273...

output:

105301950132005

result:

ok 1 number(s): "105301950132005"

Test #16:

score: 0
Accepted
time: 2ms
memory: 7928kb

input:

500 615
470 264 2116 6483
440 140 29470 23326
72 110 43214 5293
196 51 12514 42244
71 280 47085 45943
72 156 25064 13548
78 316 49949 12907
487 404 47809 27698
97 73 28640 7923
314 144 20781 47165
215 186 29540 33017
40 6 1702 36877
100 448 13492 5457
134 312 34982 45427
26 456 3457 39634
467 15 487...

output:

122025377634420

result:

ok 1 number(s): "122025377634420"

Test #17:

score: 0
Accepted
time: 0ms
memory: 10248kb

input:

500 520
384 23 14167 37928
451 70 27730 45983
361 187 1885 14513
263 474 20862 14647
405 55 37858 43463
172 115 45107 42769
261 497 31084 14910
270 68 10529 29535
462 447 38119 31465
360 265 9025 28960
30 486 21538 19889
226 115 39349 7682
336 145 39522 25071
59 101 325 44293
210 425 18047 30563
38 ...

output:

153696331934238

result:

ok 1 number(s): "153696331934238"

Test #18:

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

input:

500 748
2 309 1955 7472
466 309 12731 3830
309 202 10683 40372
309 424 12313 21845
226 309 5799 201
309 223 48026 30523
309 316 1995 16318
284 491 33672 40151
136 92 6914 40439
374 309 30718 8284
309 388 26978 46456
309 358 49433 7807
309 357 37345 27104
309 77 41751 12637
247 218 14296 49893
126 30...

output:

102303174347192

result:

ok 1 number(s): "102303174347192"

Test #19:

score: 0
Accepted
time: 2ms
memory: 7868kb

input:

496 592
444 101 9126 21347
162 314 39250 32069
47 66 49451 247
48 405 6810 48526
27 103 37728 28763
33 224 3694 25966
482 331 35767 14789
321 166 2277 34839
172 126 45593 7174
253 373 1791 31940
296 32 44668 41739
405 237 14070 6387
173 96 31495 9016
117 93 22934 579
138 60 32187 11485
39 51 21377 2...

output:

127478515292964

result:

ok 1 number(s): "127478515292964"

Test #20:

score: 0
Accepted
time: 6ms
memory: 11060kb

input:

5000 6251
2635 2866 9485 41656
3395 12 48029 28753
1355 4756 8596 41769
4409 824 14906 21781
4910 798 16065 18757
2446 236 48837 49259
250 3184 17031 3633
1282 3498 26172 32327
2917 2922 10599 11306
1851 4625 35802 9097
4677 4747 34879 46343
3183 4977 48133 33354
2573 4376 18409 5593
3747 3446 11414...

output:

12527521887194124

result:

ok 1 number(s): "12527521887194124"

Test #21:

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

input:

5000 6145
1313 3222 4495 29920
23 2998 30246 28243
4150 3094 9039 21283
1186 660 30630 41879
1763 1812 32424 20989
3687 647 22633 47318
220 3430 18320 7034
4305 218 19909 38502
1655 2152 36607 23407
4013 685 248 49464
4111 744 45162 25334
3394 1506 19103 37547
2264 694 1441 11602
2270 894 11696 4150...

output:

12904728674927010

result:

ok 1 number(s): "12904728674927010"

Test #22:

score: 0
Accepted
time: 4ms
memory: 10480kb

input:

5000 5132
3134 2216 21573 49710
1693 1306 2221 3976
736 2792 8454 22980
4451 4048 974 32205
753 3706 46077 27080
2252 4635 23240 40818
2329 4526 3018 44305
1011 2993 30907 15099
2444 4904 38134 44194
180 1855 23695 36515
805 858 6274 39268
679 472 18444 21139
2695 1566 32679 28801
1937 4421 13150 11...

output:

15210187350056955

result:

ok 1 number(s): "15210187350056955"

Test #23:

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

input:

5000 7498
4078 3807 3030 46583
1205 930 42669 31127
2905 4903 45548 47824
3975 1006 22937 20197
4052 3807 9480 13036
3205 3807 15806 36037
3348 3807 43774 24203
3807 1139 30022 28974
2336 3807 5941 42084
872 317 29856 3240
4999 3807 16501 7125
16 995 30723 44558
2832 3807 28831 614
1967 2860 42889 4...

output:

10708082290367826

result:

ok 1 number(s): "10708082290367826"

Test #24:

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

input:

5000 7498
391 4919 27448 40554
4526 4919 16307 14379
3235 4919 21435 36588
2996 2525 44325 14943
4919 4908 6274 35525
4585 4919 21247 19748
2525 2413 14469 837
1232 4919 18501 30910
1332 1303 46616 15897
1623 2525 44667 25110
727 1151 21099 16146
883 3018 29320 10446
784 4919 16245 40214
2663 2525 4...

output:

10683300618543950

result:

ok 1 number(s): "10683300618543950"

Test #25:

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

input:

4950 5537
3237 2767 1732 1676
2839 3862 99 33859
3562 4500 37761 48391
4590 2146 31777 35289
1173 1477 24413 11283
2032 4896 1970 4917
1966 3563 29713 42885
1926 2807 10896 40629
1035 4263 44088 36132
2720 2383 41990 17645
4312 4027 13763 29735
708 4566 7431 45367
886 4269 17806 45399
3073 4515 1811...

output:

13546814345599530

result:

ok 1 number(s): "13546814345599530"

Test #26:

score: 0
Accepted
time: 38ms
memory: 24116kb

input:

50000 62804
5685 3499 48845 8228
2846 8381 47609 49354
44307 21232 5341 17166
40066 38985 38065 27251
43716 47537 17905 6727
16107 47316 42861 5468
19478 38983 40301 31792
34427 1336 17517 32032
565 1391 31701 19715
23619 32518 119 1425
2184 31465 27069 27301
44327 39093 35862 6559
34167 40194 15703...

output:

1249322628058815900

result:

ok 1 number(s): "1249322628058815900"

Test #27:

score: 0
Accepted
time: 31ms
memory: 23440kb

input:

50000 61703
7328 26895 16676 4539
37252 27592 46947 39362
27484 48922 17637 38232
33726 19758 3041 389
46494 17467 8071 1023
8815 2086 2087 26447
43384 22917 28607 31308
48328 21879 33979 10279
34969 5339 45307 27811
46500 40092 19738 1395
22688 29412 47671 41175
39104 6564 49751 5541
15182 16652 17...

output:

1273746907547907939

result:

ok 1 number(s): "1273746907547907939"

Test #28:

score: 0
Accepted
time: 36ms
memory: 22604kb

input:

50000 61319
30598 22285 34899 17681
11106 10775 17154 35065
8460 677 40528 46443
13680 4868 919 11186
15512 32009 32191 28375
10544 44783 12623 12736
5108 23124 43253 20424
39337 12817 47419 5048
6879 47664 19064 2188
41071 40728 44292 27134
34409 13588 16855 20158
45688 3892 25796 47519
32310 32195...

output:

1280298662573522476

result:

ok 1 number(s): "1280298662573522476"

Test #29:

score: 0
Accepted
time: 35ms
memory: 23060kb

input:

50000 61323
30371 49819 47880 39792
37276 46891 37675 36955
29044 46206 18256 43957
22314 11640 20574 9246
20743 28823 48721 47874
39693 35330 32364 40258
43170 20266 800 39828
31153 35654 48006 21851
32343 2452 7760 8593
32833 24855 18766 12559
23457 19351 44053 978
24006 40633 6819 1499
36748 4129...

output:

1284356026638915642

result:

ok 1 number(s): "1284356026638915642"

Test #30:

score: 0
Accepted
time: 29ms
memory: 22516kb

input:

50000 60140
23967 45730 11798 32121
41349 38796 40244 41230
41154 19587 41887 31501
18643 17533 36852 29210
32618 30338 24714 11544
27003 21627 27754 16736
19571 47341 13311 34400
1807 35856 3925 7761
15973 23907 15343 9203
3824 31265 28172 34094
37178 37840 38950 12292
28505 16523 30117 48559
9440 ...

output:

1303350256146126963

result:

ok 1 number(s): "1303350256146126963"

Test #31:

score: 0
Accepted
time: 35ms
memory: 22188kb

input:

50000 59634
9478 10668 35309 25043
5128 1896 31671 48732
48930 26921 22306 29539
32571 4764 28734 3119
34726 19913 11692 23950
22537 19726 43084 2798
26452 9884 35130 7881
36483 21441 2504 4124
42472 28060 20759 41607
10325 9313 35009 2214
17039 24647 22152 40403
15333 29347 45281 45905
47613 30419 ...

output:

1320759758946920240

result:

ok 1 number(s): "1320759758946920240"

Test #32:

score: 0
Accepted
time: 31ms
memory: 18108kb

input:

50000 49999
23034 20289 19645 21524
49966 32904 24850 29331
26999 24755 15456 46057
28333 47663 24855 28589
44216 24373 27323 48953
22877 9150 47865 29724
15139 17780 31344 48430
27391 21629 4868 45371
3021 6278 24414 15532
43451 48445 24331 49101
9938 39815 37632 45806
8073 49161 12629 45647
1142 8...

output:

1566527083314718385

result:

ok 1 number(s): "1566527083314718385"

Test #33:

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

input:

50000 50287
35535 36300 42939 21885
28527 19785 37362 22871
25155 26764 30079 3452
19351 15092 22480 11523
23575 41067 7265 9983
300 15193 23249 9249
24083 11675 5457 22702
6676 18384 27013 49776
6658 7391 33695 12867
3445 31151 3725 9241
28383 13721 4313 6400
36661 10677 27231 3521
41197 46266 3365...

output:

1551839422424709055

result:

ok 1 number(s): "1551839422424709055"

Test #34:

score: 0
Accepted
time: 19ms
memory: 19324kb

input:

50000 50106
15290 6401 30099 36096
20404 23568 42583 47154
7175 1414 6360 25129
1936 46023 13235 22242
22480 44096 30834 4870
26579 19918 22773 30790
17818 3025 17148 8041
28944 42595 20257 40595
42723 40443 5566 5234
24671 47984 32655 3172
27980 24535 11511 39784
46769 23784 8267 27475
17128 25023 ...

output:

1557327200447922288

result:

ok 1 number(s): "1557327200447922288"

Test #35:

score: 0
Accepted
time: 39ms
memory: 29004kb

input:

50000 66514
32809 38123 22474 16634
49494 48671 33438 19590
37411 41981 5630 25674
464 46337 45361 17983
7661 24741 27434 43924
21614 34016 15235 18692
22633 49346 19401 25850
19749 12186 21212 33576
32223 13898 13909 8017
5194 8880 6936 25074
49103 15989 4544 45112
27443 35996 21502 27416
17208 201...

output:

1217306703295306920

result:

ok 1 number(s): "1217306703295306920"

Test #36:

score: 0
Accepted
time: 44ms
memory: 31776kb

input:

50000 74998
21288 16612 4639 45701
12014 16612 22866 31789
4908 39060 3925 40208
6297 16612 46194 31394
43170 16612 20262 18952
21544 16842 40285 30442
38103 16612 35411 27933
9463 29889 14707 29160
16612 26291 49226 35969
16612 9571 16221 14234
16612 10724 29101 5970
41271 16612 36459 42770
33780 3...

output:

1059807958352246376

result:

ok 1 number(s): "1059807958352246376"

Test #37:

score: 0
Accepted
time: 44ms
memory: 31664kb

input:

50000 74998
10988 30321 35139 16076
6082 30321 32820 14773
46182 30321 19838 5692
30321 23270 39988 6548
30321 12200 38468 1483
32462 30321 4037 25656
27051 30321 37007 30475
30321 34308 5808 32521
36095 33162 48027 26829
21760 30321 658 25168
28868 33011 28005 33437
30321 257 35582 40017
44585 3983...

output:

1063252038029044152

result:

ok 1 number(s): "1063252038029044152"

Test #38:

score: 0
Accepted
time: 38ms
memory: 31816kb

input:

50000 74998
48088 9466 1735 10719
27085 48088 9545 13072
49081 48088 3142 24972
48088 29934 35627 12616
47618 48088 29091 34962
48088 12434 9697 37044
48088 12939 4085 25054
27649 31973 32671 15005
16760 48088 41859 7482
48088 47009 31311 29401
39527 48088 28857 35143
48088 43564 10890 19103
48088 1...

output:

1063514815909341689

result:

ok 1 number(s): "1063514815909341689"

Test #39:

score: 0
Accepted
time: 40ms
memory: 31584kb

input:

50000 74998
40538 1909 21562 42306
46543 17885 4894 11170
2844 17473 11566 48342
33371 40494 21355 5133
40538 8282 5751 38607
15807 39951 24770 23687
2824 40538 33849 11777
19377 40538 32564 14983
40538 2447 18870 12189
40538 34704 3914 44398
17920 40538 48096 30950
40538 39912 10371 20645
40538 336...

output:

1060621094503124025

result:

ok 1 number(s): "1060621094503124025"

Test #40:

score: 0
Accepted
time: 33ms
memory: 31636kb

input:

50000 74998
1179 29976 29663 27139
46647 40245 798 18021
11986 18058 36738 23794
15189 11139 15850 672
47094 31776 8316 24086
29976 38116 43851 822
5679 8177 25519 15970
14359 18058 34552 44809
18058 8968 49276 44664
8545 653 42433 43987
29976 40700 4688 2131
39072 41357 5996 34510
24175 12177 31123...

output:

1059525207997214296

result:

ok 1 number(s): "1059525207997214296"

Test #41:

score: 0
Accepted
time: 33ms
memory: 31784kb

input:

50000 74998
14158 7575 3935 20416
29520 3402 22845 47645
3402 47678 19580 41300
49925 11951 26468 32027
3402 43637 47587 45308
17513 3402 37606 41323
18230 3402 33335 15588
13654 27518 46259 32488
10343 10022 22578 11466
11951 2803 34432 12913
21738 11951 42270 31274
37333 3402 19417 45857
17232 485...

output:

1062704043866330099

result:

ok 1 number(s): "1062704043866330099"

Test #42:

score: 0
Accepted
time: 43ms
memory: 31568kb

input:

50000 74998
27194 2698 31003 44854
23294 15276 49660 38223
23294 44493 27575 31534
23294 13990 23918 18569
2133 23294 15159 21746
6848 11793 13948 22996
27082 3435 37228 11255
41411 23294 4293 17656
23294 21707 22245 19277
6755 42863 27718 16059
30652 43585 31537 48435
36126 44651 14226 25024
18288 ...

output:

1060710590904825974

result:

ok 1 number(s): "1060710590904825974"

Test #43:

score: 0
Accepted
time: 25ms
memory: 16808kb

input:

49770 53911
32661 8636 31360 47400
13966 37584 41471 27846
17212 2715 37731 186
1856 37725 465 25194
885 2776 39234 47471
12550 26400 12617 22397
5442 1977 18862 38833
13870 39736 30108 16214
28546 46914 38600 38620
29044 25112 1650 43307
49110 4255 13444 42123
2197 28629 45560 29867
39563 13306 203...

output:

1418313550166867218

result:

ok 1 number(s): "1418313550166867218"

Test #44:

score: 0
Accepted
time: 21ms
memory: 15648kb

input:

49770 52609
14764 12196 232 48202
32708 35139 29781 2966
7222 41733 2264 27729
12228 31785 5264 25816
33455 15127 11283 49696
34838 37727 5899 41953
39877 35718 32408 2387
20429 46896 48488 6328
8636 29533 46143 29536
27821 47003 18673 10133
48938 15720 23208 9166
1341 32246 2866 32002
47606 8580 32...

output:

1444351211084516823

result:

ok 1 number(s): "1444351211084516823"

Test #45:

score: 0
Accepted
time: 19ms
memory: 14612kb

input:

49770 51317
49463 8026 35062 1774
30546 3349 15552 30126
729 25290 43677 42796
21416 4797 2947 44454
25473 43753 37411 45344
27340 42213 10709 11648
44122 4919 25265 25977
16167 2281 33575 17282
14260 34523 38266 8203
9983 34882 34171 38493
49311 43085 36785 3297
43576 3833 26789 10904
37867 9212 35...

output:

1480613139662489360

result:

ok 1 number(s): "1480613139662489360"

Test #46:

score: 0
Accepted
time: 35ms
memory: 26596kb

input:

49770 66812
49273 36474 10788 19789
10440 8314 30329 24395
17707 28502 20142 11350
25631 28740 17171 13189
20162 48538 48545 20931
46782 25174 1986 12799
38852 11414 21740 45235
45295 30418 38199 13924
35343 32579 49911 17720
240 10683 40048 37466
15322 17798 48863 41053
3347 22369 10654 5425
12026 ...

output:

1190996735991822300

result:

ok 1 number(s): "1190996735991822300"