QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#59923#1215. Wallshydd100 ✓479ms27272kbC++143.0kb2022-11-02 02:51:002022-11-02 02:51:03

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 4ms
memory: 6268kb

input:

1 10000
915674415 938163145
445122899
105429572
102455971
361966249
191792817
916302602
420316032
506002921
915400897
952475112
666624152
228058769
740352104
881339205
61684889
502170031
218846044
775588220
523713706
992107289
561711394
689944341
105847966
801014268
457566357
78355503
404741928
3652...

output:

3167610770341

result:

ok single line: '3167610770341'

Test #2:

score: 0
Accepted
time: 288ms
memory: 18180kb

input:

1 200000
182252084 799595168
423954479
127122177
90201023
836449215
213044113
165072414
406880996
698847661
627972319
214039937
679927993
590703803
30475640
480797550
5050246
270157677
525908136
401533390
195095826
900552038
777880069
810834890
16129710
963900079
227600938
776585871
532309648
959441...

output:

10168440730079

result:

ok single line: '10168440730079'

Test #3:

score: 0
Accepted
time: 408ms
memory: 24372kb

input:

1 200000
228157465 540376396
431556815
943615214
72345891
422511362
375100738
792205230
87117650
351573505
255923556
693398593
678819994
754648448
43980340
187656662
126766284
247604151
72663185
468630496
216465623
383675509
357877222
725519569
416038175
675272565
229476722
346338600
92733968
819879...

output:

26411151456977

result:

ok single line: '26411151456977'

Test #4:

score: 0
Accepted
time: 294ms
memory: 24476kb

input:

1 199983
377464184 563302180
41661033
50261624
48462291
449727214
342958917
657967697
298951604
760480110
463612536
582693192
250941123
436791760
283683261
446767118
290917971
840360806
552846020
878102368
194562161
639750070
536588070
581540143
329362631
648862827
602560928
725793870
559805227
8229...

output:

38647403053772

result:

ok single line: '38647403053772'

Test #5:

score: 0
Accepted
time: 279ms
memory: 24344kb

input:

1 200000
559291501 828906549
41595496
10439780
411748904
90386755
187281627
131165617
891880887
271687952
707621661
335487990
353405633
344914720
891524019
346342063
828581721
161426993
225431683
206907037
730975803
682527757
791977618
561515032
998713240
400736248
645066998
212389480
943305445
3061...

output:

30128093552684

result:

ok single line: '30128093552684'

Test #6:

score: 0
Accepted
time: 184ms
memory: 24368kb

input:

1 200000
165514452 214513048
41529959
50130550
33690698
376263997
169541341
968566846
740514187
860388770
305479859
706540982
594029240
933341399
373598579
537821215
244472404
471877466
384628902
529517505
95296128
210267253
39798093
775110840
292823588
785319613
72955480
99688966
95848265
405012550...

output:

57709076379660

result:

ok single line: '57709076379660'

Test #7:

score: 0
Accepted
time: 27ms
memory: 5648kb

input:

1 200000
967267238 967267239
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
41464401
4...

output:

925802837

result:

ok single line: '925802837'

Test #8:

score: 0
Accepted
time: 34ms
memory: 5724kb

input:

1 200000
715966741 715966742
1092
10822
13249
16337
26720
27438
31082
35097
48366
57232
68500
82857
98600
103344
105363
107091
112467
114134
118650
121122
123567
124708
129800
133387
137964
139947
141391
143340
145551
146012
150149
158078
163251
175249
179709
187800
188109
200923
201627
207069
20821...

output:

1715962602

result:

ok single line: '1715962602'

Subtask #2:

score: 45
Accepted

Test #9:

score: 45
Accepted
time: 27ms
memory: 7288kb

input:

20000 20000
0 639232223
0 321264049
0 233388198
0 531873755
0 302594299
0 600409248
0 699751059
0 929416663
0 786156226
0 343381963
0 739531343
0 727302825
0 534894725
0 917431068
0 124972355
0 23035344
0 424371806
0 551533410
0 393292515
0 848715369
0 249836285
0 329875509
0 303796209
0 437918621
0...

output:

899171132004
3164351007371
4019857044166
1512469467158
3338653580177
1102122041967
622947732765
34449518277
315110908727
2963600923393
468005357053
513390754613
1492989284738
46992279015
5205677149323
6467298384588
2283740512830
1387909329481
2534986857574
157587938865
3853170754353
3085445979911
33...

result:

ok 20000 lines

Test #10:

score: 0
Accepted
time: 294ms
memory: 18460kb

input:

20000 200000
0 52179657
0 787412586
0 622418261
0 996958118
0 526489157
0 897975497
0 12228555
0 342314216
0 92876313
0 634133340
0 489467971
0 63867174
0 560013085
0 351124973
0 888836892
0 152760674
0 802366067
0 709014005
0 200518687
0 797675090
0 25515092
0 544879523
0 851149734
0 740883406
0 27...

output:

61173330259858
3124177725641
9896068105391
584318537
15548236307270
711536526274
66337215919732
29830234230850
56123704372958
9291215760553
18060948254594
59701150076324
13431955870847
29045973702406
845135359167
49090135786494
2697778885567
5870376912719
43810176011846
2828228977743
64597107700702
...

result:

ok 20000 lines

Test #11:

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

input:

200000 20000
0 184393479
0 199447119
0 126451966
0 56703536
0 319940154
0 715736899
0 449693808
0 732122075
0 862754517
0 416735508
0 140234904
0 178332812
0 261455246
0 735844613
0 119872949
0 684931067
0 942914896
0 437371853
0 639509160
0 232106004
0 345682459
0 420045296
0 85773600
0 648114838
0...

output:

4459389398023
4297391167155
5109475914205
5950182151759
3112805263187
552895095278
2046848072561
491316261744
128926296753
2296715849415
4950904242891
4525381782925
3663370882199
477806263324
5186149161973
678951897890
22834530490
2138517247989
887396889827
3956686972687
2884385690407
2270935270117
...

result:

ok 200000 lines

Test #12:

score: 0
Accepted
time: 473ms
memory: 27272kb

input:

200000 200000
0 54677065
0 515144869
0 397119423
0 51865536
0 661889140
0 775753453
0 332143875
0 921515631
0 34055532
0 60085710
0 928118827
0 156912071
0 954831885
0 670004745
0 160342661
0 89394321
0 96862794
0 55222209
0 237200309
0 250177006
0 6925046
0 612128752
0 13972992
0 547550271
0 614715...

output:

56526072878913
12564354499782
19711558137284
56992752951487
6150462904559
2781578344967
24551794637533
370635552273
60051002309945
55639891342307
313075827539
41969742676935
128661616709
5865961601918
41549879696349
51088284313343
49990280619465
56436067932331
33067186363199
31788705165837
650850295...

result:

ok 200000 lines

Test #13:

score: 0
Accepted
time: 389ms
memory: 20900kb

input:

200000 200000
0 164451877
0 151723459
0 864598890
0 489311722
0 38278509
0 670956267
0 537233303
0 556683807
0 647286213
0 827120405
0 734261220
0 908090023
0 691342737
0 770486070
0 159973874
0 121616559
0 610782316
0 788303234
0 177765453
0 83662592
0 881716402
0 588673893
0 771786768
0 25242656
0...

output:

47503976414876
48941198601982
1256137594175
17919424229268
62679015480356
7441932839306
14719948299392
13510743240928
8551923311982
2052244329670
4856160973383
578489544483
6548603645354
3622055100781
48007197619777
52425562138172
10414952250468
3081378169333
46023346057524
56984647566201
9579166685...

result:

ok 200000 lines

Test #14:

score: 0
Accepted
time: 437ms
memory: 27072kb

input:

200000 200000
0 869196039
0 185616225
0 361231438
0 565401677
0 56820894
0 52751904
0 536565613
0 312944241
0 777755842
0 558181754
0 430193190
0 484452928
0 182122930
0 182353730
0 432584503
0 711285114
0 371732153
0 488944299
0 407737948
0 496525
0 80977656
0 892390277
0 500389936
0 476847348
0 21...

output:

997954805036
38830491096458
22485895824321
10199229712072
56414791849730
57085514096604
11595083075372
26326352771238
2760510990647
10539299479197
17676614848399
14385771839749
39231536907140
39204927475520
17523068464570
4579360785729
21703520855194
14131479470784
19158915443145
66583262402422
5260...

result:

ok 200000 lines

Test #15:

score: 0
Accepted
time: 366ms
memory: 20920kb

input:

200000 200000
0 748246765
0 369310764
0 27795717
0 157066901
0 968189895
0 573608248
0 920920016
0 236786674
0 556717836
0 925801768
0 234789720
0 434899929
0 430674470
0 332185550
0 372709216
0 631347652
0 716871416
0 497274459
0 717236836
0 661639133
0 161204901
0 568314304
0 84960847
0 302091112
...

output:

4389090552639
27298166848615
63929630456440
48286768631672
68000076993
12574726238333
428518314752
39737305335947
13585295426393
376852720762
39941787276065
21979851682765
22305238375369
30557015036481
27008653953165
9408724291383
5552528327221
17441265248061
5538203259061
7929203154743
478234364800...

result:

ok 200000 lines

Test #16:

score: 0
Accepted
time: 473ms
memory: 27132kb

input:

200000 200000
0 15557131
0 288871823
0 797053213
0 228783458
0 59838039
0 594000007
0 169723520
0 801539323
0 555455327
0 55367834
0 514904715
0 78126806
0 785671832
0 532030612
0 261798799
0 261116856
0 125499812
0 883856810
0 739990093
0 340002202
0 641346446
0 867139351
0 87499283
0 363337315
0 5...

output:

63549770783455
28222714377981
2281343435832
33964889581595
55782550211953
8825357648229
40491118140549
2184680412722
10572872555351
56516742833575
12598507092617
52884446934103
2535808242140
11717770585105
30706033825751
30770739015869
46077863698313
778783667994
3690153762982
23945433146789
6908474...

result:

ok 200000 lines

Test #17:

score: 0
Accepted
time: 78ms
memory: 8384kb

input:

200000 200000
0 1
0 1000000000
0 65968691
0 1
0 165312879
0 1
0 1000000000
0 1000000000
0 1
0 1000000000
0 1000000000
0 881068570
0 1
0 1
0 959848985
0 1000000000
0 1000000000
0 1000000000
0 1
0 1000000000
0 720571313
0 1000000000
0 1000000000
0 1
0 1
0 1000000000
0 1
0 1
0 1000000000
0 1
0 1
0 1
0 ...

output:

619389152
0
553420462
619389152
454076274
619389152
0
0
619389152
0
0
0
619389152
619389152
0
0
0
0
619389152
0
0
0
0
619389152
619389152
0
619389152
619389152
0
619389152
619389152
619389152
497078821
111540389
619389152
619389152
619389152
619389152
336076451
619389152
0
0
0
97841733
0
0
0
4843980...

result:

ok 200000 lines

Test #18:

score: 0
Accepted
time: 249ms
memory: 27120kb

input:

200000 200000
0 791496
0 2407484
0 2897340
0 3780011
0 3127296
0 4508352
0 3555072
0 210360
0 4299648
0 3451584
0 4784184
0 2775960
0 851232
0 4771393
0 478872
0 1129457
0 2787096
0 436248
0 1485698
0 2881824
0 3771299
0 56928
0 2953294
0 3066624
0 1298976
0 3466104
0 2021295
0 1808550
0 3968472
0 1...

output:

335250169064
119751570628
75918112772
22174022511
58789552640
2271907424
32787830144
439347607880
5715419072
38379028064
505203464
85847694680
325347373904
517034873
389500905944
281183287957
84911129240
397213058072
229344129250
77153190224
22545855401
469179545072
71547473554
63094807424
255855938...

result:

ok 200000 lines

Subtask #3:

score: 45
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #19:

score: 45
Accepted
time: 404ms
memory: 20828kb

input:

199983 200000
982052302 996578304
887720388 943154050
153013477 869347360
151671509 640978744
418025719 821005090
575922942 666319961
384844894 427292265
125004588 607642667
16334819 115966805
79089453 924651514
526256616 828227964
743260457 779308675
438705134 868023034
362412615 674406977
96198900...

output:

65669091345525
60411692626295
5594819784682
17998543518330
24513852714140
56094469909305
62055648612827
18467043672415
54980916714850
1657068582658
33347373378163
62874936672590
22424122866869
32411869193078
67294224050993
57297152357691
52700573307064
67038773191803
48920744600691
55783429398285
62...

result:

ok 199983 lines

Test #20:

score: 0
Accepted
time: 471ms
memory: 27124kb

input:

200000 200000
164459468 179480461
81867865 342011511
783626419 917251410
241877787 280035940
675379348 963981082
735906048 753721184
554482951 559465625
816744047 848143460
835659442 940490567
309744041 447456212
639914306 933407637
338918686 346335237
488526823 557725338
644713985 997872705
2007467...

output:

63711604242319
30986208099328
45131628642153
59522923574602
28362503386155
63187797225340
65641412388165
60712063587668
49059673042740
44598415997805
27928593721770
65166217553385
54387382258357
23010230853870
9262509795036
46201103498373
61070980247254
62726320969395
28474516382558
63164262098217
6...

result:

ok 200000 lines

Test #21:

score: 0
Accepted
time: 369ms
memory: 20756kb

input:

200000 200000
669318386 942870606
520189445 849275295
128269162 293300157
348777857 809175911
846492875 955022872
183378088 315340494
383222442 627762612
660605422 909909538
113875856 594123002
170865692 754758994
424904546 627620994
175779306 968369877
582151432 585909775
198301231 864906894
134495...

output:

36034440967642
30804585130433
47388887110614
20015660440647
53897932126091
51147935437122
38922214614668
38440956829304
18581515120520
11934333878203
43274057846738
2968869386365
67080473416592
7663072889295
20779719845574
186741239268
50931509400984
12334891882557
57043532116805
46066063860298
3559...

result:

ok 200000 lines

Test #22:

score: 0
Accepted
time: 400ms
memory: 24788kb

input:

200000 174205
233929816 876250478
215689333 697615785
108572868 706911223
260797597 261430468
138069694 718042184
436696630 512201218
350580879 406107549
596574255 755034310
139811298 200888594
246626848 447194551
511785624 516802071
364457723 917802145
732405316 783323131
71917722 667665653
7258843...

output:

6012903589524
12616111507154
7561122907721
57977074484039
8264484076698
46545963198299
49323063655500
36599935879899
48533622276267
32337830729162
57221754687852
9343333025765
49989707019930
7658262998151
47250028897177
33784804882183
55250993542609
24413368390967
49959696951263
23768126578
31663089...

result:

ok 200000 lines

Test #23:

score: 0
Accepted
time: 370ms
memory: 20908kb

input:

200000 200000
180409918 931453305
370047873 815984627
137294809 464119998
4458531 996831471
237519168 367017701
414401022 870202498
731165792 850045915
466380668 992530166
316860994 895525165
432838149 881519392
47407323 970139312
297914736 886981804
63901008 878402942
9227112 939372797
107836630 36...

output:

4280800973058
21171794560009
31084069100633
4267774314
51532081182287
20433213512276
52775144190898
15526009065558
12282379430954
20965010649379
412884125955
11684146162058
2378249970012
336995335654
38125497901616
5923962421140
62519371598853
40301043802692
8999527045772
1697911693213
2512767030828...

result:

ok 200000 lines

Test #24:

score: 0
Accepted
time: 479ms
memory: 27272kb

input:

200000 200000
37720760 992907498
894066798 971799403
152584049 390874670
461760372 612740406
293589802 580971206
213114355 369367512
121471589 935905001
454168265 654995506
425230097 473092654
145566257 863618869
272390223 811650621
250145352 627613479
464203236 963040591
606533274 658573092
2963078...

output:

124834927261
53197659241331
33265048249944
43056357133856
28604226006582
42401186841256
1950030037023
37205258241040
58004869322980
4368218149763
11473219173973
21325762954133
13598929341611
57304256874728
27734668525264
7552027875284
31591217612162
41781206970795
15580760813563
22868654249146
36368...

result:

ok 200000 lines

Test #25:

score: 0
Accepted
time: 73ms
memory: 8452kb

input:

200000 200000
201507991 735242958
84628054 610353278
434673979 834414016
826271845 965586025
454257939 690321068
702526627 805862813
534955596 758722436
828577165 966801050
95700897 183788664
453294871 688930072
249418221 566564830
485144614 660119098
58218833 281301410
41300856 491433557
733093056 ...

output:

0
0
154308331
545906197
173892291
422160979
254589948
548211517
96576984
172929223
0
204778966
0
0
452727408
311241854
0
212348985
4339067
353172732
169214401
98316453
381542718
0
640838860
534933892
605926979
259146959
0
219872609
167480618
227545947
51232982
0
320231282
310868434
458493543
6333613...

result:

ok 200000 lines

Test #26:

score: 0
Accepted
time: 90ms
memory: 8420kb

input:

200000 200000
439830788 732782971
386570803 519557598
261232735 538422300
6319939 734020585
202353050 527055661
5548602 730613937
889598102 963619328
848490786 876812203
91968712 908034363
477174018 642849022
604828013 782848829
53917936 394722326
380220054 614734636
785075897 850235303
156694542 75...

output:

1146852657
1253558060
984017222
278593345
877624491
280457319
1815550928
1820143421
275877113
1311473066
1426781249
713087598
1145679524
1719890543
557476047
790109203
1564900900
917801745
1885384458
518390118
1256071235
846577475
1391057503
906591687
1850258090
908186584
1927952618
1496056595
13720...

result:

ok 200000 lines

Test #27:

score: 0
Accepted
time: 238ms
memory: 27176kb

input:

199998 200000
98672466 99607644
36936665 41056441
4606530 6418242
252501931 256270723
542597457 543308673
130259022 134107775
285065698 285224794
336955605 339672789
695268808 699372049
230352335 233378655
657384612 660425508
806542926 808383833
83579066 84276986
525121503 526349559
754998997 755760...

output:

311583751220
10102404279
186532757054
22400939533
348335440561
19220741503
448920737542
90539554859
10308943433
65809192961
64624148452
182726550521
350978126694
265831334263
340099151981
26717323677
34617808177
82878917799
95369559105
149846325258
1867411128
225158317663
288885536317
115346286986
3...

result:

ok 199998 lines

Extra Test:

score: 0
Extra Test Passed