QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#425597#8727. Dvobojznstz11 45ms3876kbC++141.6kb2024-05-30 14:26:142024-05-30 14:26:16

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 0ms
memory: 3656kb

input:

10 10
1361914 207572678 628126347 376128984 883488318 186963880 762865354 326392578 98149107 158171745
2 2 3
1 2 570852623
2 1 3
1 10 841056888
2 1 3
1 10 496132858
2 1 1
2 3 3
1 3 99470035
1 7 296222622

output:

260852338
57441684
57441684
569490709
406038050

result:

ok 5 number(s): "260852338 57441684 57441684 569490709 406038050"

Test #2:

score: 11
Accepted
time: 1ms
memory: 3688kb

input:

16 1000
1361914 207572678 628126347 376128984 883488318 186963880 762865354 326392578 98149107 158171745 61370500 127856987 9580346 570852623 646119601 178503575
2 7 1
2 2 2
1 14 993939084
2 14 1
1 9 73368655
2 4 3
1 7 60357102
1 8 631246136
1 9 220513513
2 6 3
1 7 653851474
1 8 456503385
1 5 371026...

output:

436472776
86805665
347819483
87680538
262650449
984358738
235989872
272256206
29264121
185977251
194839926
251930935
42658454
11990820
42658454
66029961
440700537
577605510
425326019
466887594
813607132
362972407
48387898
63098914
627944703
66763262
232922824
133094310
197750495
217535675
147044123
...

result:

ok 482 numbers

Test #3:

score: 11
Accepted
time: 1ms
memory: 3620kb

input:

65 1000
1361914 207572678 628126347 376128984 883488318 186963880 762865354 326392578 98149107 158171745 61370500 127856987 9580346 570852623 646119601 178503575 484012895 61261435 841056888 558195739 940535012 26358306 579095855 496132858 925772919 837126193 70268510 656565238 285836282 902043521 4...

output:

142337918
150548605
186695351
125217148
255203325
67291398
2648908
43043613
24226412
439183520
586296728
301501346
53682976
162406540
15657443
9885849
214706015
557305213
107800702
316326531
582297695
57541160
323146440
73732386
540396274
6958073
66486487
23042085
43666455
431577775
513356186
122913...

result:

ok 511 numbers

Test #4:

score: 11
Accepted
time: 1ms
memory: 3876kb

input:

65 1000
207511447 51272873 735603123 397076404 966916484 512320076 284382040 309429435 925716265 984330314 993127948 350498868 45242528 900122009 684637316 831057517 741828281 15030115 353216803 809527525 239951084 256630526 410747900 814013515 374895460 729376753 825213139 866764416 919429888 90646...

output:

22719394
273594757
184364296
45650570
227938036
348854302
216595057
69898465
123042137
547078655
353085422
31441046
163125351
150694751
254724553
125642109
474668
48784322
137746777
306679127
73236309
156188397
440590243
158822954
204074514
554177487
121598645
554177487
79359359
28590241
1539380
197...

result:

ok 523 numbers

Test #5:

score: 11
Accepted
time: 1ms
memory: 3732kb

input:

1000 1000
213378079 34508930 71287632 637752859 659977531 245762954 455483857 576582109 939803654 62528280 91772795 567245160 519776559 648525642 440759601 870753993 79121233 830364070 836922059 472097926 892749051 474527526 13096716 725009293 54135466 810116149 53609387 541454656 864260299 14827229...

output:

819243849
384496460
645939128
413892067
94704584
46680458
230543380
225168786
34308778
339710774
192803453
32592119
40448274
42815583
63939569
222218236
280995802
136044778
35905755
119728
46667819
6818746
320476902
292971525
272187426
243488937
154852879
318333429
298487803
156117205
352232549
2838...

result:

ok 524 numbers

Test #6:

score: 11
Accepted
time: 1ms
memory: 3632kb

input:

1000 1000
213596176 131514609 673536873 841721579 668353587 236064010 832632352 957205489 549880437 108760725 839907133 477543143 403049855 971248008 21939809 67431032 992061289 918570185 971654557 772163398 838389695 677675052 174311284 917009882 335321465 910674552 241976533 256318642 627949826 72...

output:

141553262
35087683
300166489
320091116
286621845
67645693
255636870
321861687
662594396
171132776
423848815
164112050
129034703
240963802
275224941
589646
194519241
103261333
5956571
156098709
244885556
335364865
181737317
273587357
43739830
146237615
238995140
51774342
363760436
53710912
239696030
...

result:

ok 477 numbers

Test #7:

score: 11
Accepted
time: 0ms
memory: 3736kb

input:

1000 1000
213705226 716855592 11532404 943755091 135687088 231214538 484335687 610646267 354902444 168780627 140216095 969513894 881557414 595787431 349368057 92044113 374822261 425818714 39037190 922212518 811242785 779232431 791789479 12993791 12736224 424082842 909885545 113750635 509827356 47782...

output:

400459814
201418778
97817103
101202496
101232344
126369058
386988434
449061123
497907128
239411107
73562892
60291011
10853609
215848031
198911635
856136103
324760569
209857607
281170280
112506308
135756415
117330976
61224204
235579329
102640489
206365168
147494798
224911679
435403922
129389938
25091...

result:

ok 506 numbers

Test #8:

score: 11
Accepted
time: 1ms
memory: 3660kb

input:

1000 1000
213781507 228520287 275818880 45723066 676729644 226365066 136039024 264119813 159957219 228734993 514299648 387808358 286323150 220261319 676829073 190399016 831325058 6776299 32645233 72261637 784063107 880822578 335558619 35301414 616474697 11200187 504085501 44891683 391672120 22978818...

output:

160711136
324248029
205251300
24085371
284024914
231417855
844716399
141214150
202127290
14050109
341466449
157258185
109726110
66789769
71324859
296404158
282847563
8096429
63717687
241501586
194942018
196345301
338485818
34093662
128858414
279129154
443668432
478997435
51797012
246854082
131907601...

result:

ok 486 numbers

Test #9:

score: 11
Accepted
time: 1ms
memory: 3700kb

input:

1000 1000
214032373 325525965 951777177 175982732 685072933 216666122 513187518 644743194 843743058 348709261 188692163 298073574 169629214 542983685 257976513 387043289 670556058 21273359 167377731 298618054 729703751 10228281 496805954 227302003 897627928 38049535 766161701 759755670 155427181 807...

output:

277141918
235454347
365324681
202940860
20329203
210642204
46115467
48106060
573038529
221128330
140628685
205087339
64509805
146397506
6800712
253176214
31396794
411974102
11460523
89303493
25487492
256998462
479895476
294381914
119982133
138882109
139322432
268937129
85705093
439193820
118020357
8...

result:

ok 510 numbers

Test #10:

score: 11
Accepted
time: 1ms
memory: 3768kb

input:

1000 1000
339631232 358854319 465176920 725456574 224720478 969211987 710307753 744328097 656189083 982581416 178522774 239824216 373676202 9988302 284004938 941896061 795118324 264881243 868072678 358005529 37931724 73597773 656729204 182694053 590982265 4363286 72819444 882741771 46457647 57222133...

output:

174176325
225788486
75577805
102122893
54288788
186859227
77413498
279099073
119319777
311859316
32925563
128565968
14953978
199633402
147074367
159726214
74560293
82460793
223348007
124751594
71739589
205731243
20279323
110626855
159955434
207874198
283086711
248125642
37707497
120782314
322135930
...

result:

ok 486 numbers

Subtask #2:

score: 0
Time Limit Exceeded

Test #11:

score: 13
Accepted
time: 31ms
memory: 3692kb

input:

2 200000
583392119 251603292
2 1 1
2 1 1
1 1 38574148
2 1 1
2 1 1
1 1 42719181
2 1 1
1 2 536876485
1 2 761201073
1 1 335510282
2 1 1
2 1 1
2 1 1
1 2 371383902
2 1 1
2 1 1
1 1 378794551
1 1 224150551
1 2 812716786
2 1 1
2 1 1
2 1 1
1 2 129793340
2 1 1
1 1 654577279
1 1 150709706
2 1 1
1 1 883829174
1...

output:

331788827
331788827
213029144
213029144
208884111
425690791
425690791
425690791
35873620
35873620
588566235
588566235
588566235
94357211
20916366
647936652
647936652
459423963
459423963
459423963
176008535
176008535
398886231
398886231
398886231
10658183
10658183
10658183
1477309
1477309
423872241
5...

result:

ok 99810 numbers

Test #12:

score: 13
Accepted
time: 33ms
memory: 3688kb

input:

8 200000
583937365 30955631 71369406 563916968 642881599 641904678 121445755 920580908
2 1 3
1 5 540256764
1 8 562659914
2 1 3
1 6 770926584
2 1 3
2 1 3
2 1 3
2 1 3
2 1 3
2 1 3
1 2 843982298
1 5 935286660
1 3 978153407
1 7 383158846
1 5 832692766
1 2 58984923
2 1 3
1 5 599293737
1 7 891437740
2 1 3
...

output:

737724060
279132073
150110167
150110167
150110167
150110167
150110167
150110167
7018883
46428976
271079153
361390048
361390048
198270139
198270139
198270139
3058280
3058280
3058280
3058280
156874444
203315832
203315832
24294559
24294559
333451673
333451673
408021917
408021917
408021917
249116721
586...

result:

ok 99806 numbers

Test #13:

score: 13
Accepted
time: 45ms
memory: 3632kb

input:

128 200000
584667941 833604594 289821715 204082050 135277733 607958374 904627342 642215537 851862185 918490066 11161382 578052298 945488065 100848470 671298278 643164130 337474286 341210108 509998661 364095486 9419682 751509443 595566895 968206932 413460927 242350233 527753469 808018697 17026711 530...

output:

233794795
26950959
26950959
61031769
275489501
275489501
291739948
291739948
11887608
51682559
133293465
133293465
133293465
32136635
32136635
142223630
190940681
190940681
190940681
190940681
265354431
132261455
1340730
1340730
26308845
26308845
182270618
93242112
131028415
131028415
131028415
1310...

result:

ok 99805 numbers

Test #14:

score: 0
Time Limit Exceeded

input:

1024 200000
585431285 636253556 508241256 917988956 701382924 574044838 614034338 363850167 560823596 264690948 408422480 800884232 106455 693522224 815976206 257775561 311702851 113142518 981513256 340664734 892903760 388767577 623012504 566450785 860691861 57400966 908214794 883751704 263780180 94...

output:


result:


Subtask #3:

score: 0
Time Limit Exceeded

Test #21:

score: 16
Accepted
time: 30ms
memory: 3688kb

input:

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

output:

1
0
1
0
0
1
0
1
1
0
0
0
0
0
1
1
0
0
0
0
1
0
1
1
0
1
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
0
1
0
0
0
1
0
0
1
1
1
0
0
1
1
1
0
1
1
1
0
1
1
0
0
0
1
1
0
1
1
1
0
0
1
1
1
0
0
0
0
1
0
1
1
0
1
1
1
0
1
0
0
0
1
1
0
0
1
0
1
1
1
1
1
0
0
1
0
1
0
1
1
1
0
1
0
0
1
1
0
0
1
0
1
0
0
1
0
1
0
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
1
...

result:

ok 99564 numbers

Test #22:

score: 0
Time Limit Exceeded

input:

1939 200000
1 1 0 0 1 1 1 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 0 1 0 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 ...

output:


result:


Subtask #4:

score: 0
Time Limit Exceeded

Test #36:

score: 17
Accepted
time: 30ms
memory: 3668kb

input:

10 199991
37507664 194554609 209371390 279132948 336712965 55899332 339663138 116632087 630544272 741907097
2 9 1
2 1 2
2 8 1
2 5 2
2 7 2
2 3 2
2 1 1
2 2 2
2 3 2
2 8 1
2 5 2
2 1 2
2 7 2
2 3 3
2 3 3
2 2 3
2 3 3
2 8 1
2 5 2
2 5 1
2 1 3
2 1 3
2 6 2
2 2 3
2 6 2
2 3 2
2 9 1
2 1 3
2 4 1
2 5 2
2 1 3
2 7 1
...

output:

111362825
87285387
513912185
57782582
111668226
211052075
157046945
42763236
211052075
513912185
57782582
87285387
111668226
99383849
99383849
187385143
99383849
513912185
57782582
280813633
29502805
29502805
230148379
187385143
230148379
211052075
111362825
29502805
57580017
57782582
29502805
22303...

result:

ok 199991 numbers

Test #37:

score: 0
Time Limit Exceeded

input:

1999 200000
205692769 142360920 151664892 907598214 795405922 175632467 244285343 27143079 276583249 298501268 10594969 264860871 214952974 216471286 246014885 813525591 366151081 791406855 51362983 564502909 189581922 488801024 260871099 259427596 33809830 12440012 89525027 18182534 403088409 93881...

output:

10520410
204683661
144721089
157181441
8767676
31099310
113863300
40340992
301671345
179722383
0
96776505
120405092
0
283985405
379036884
62468336
302138883
315150725
261999205
46435570
108353954
228065350
126017136
0
223207564
355228904
130380556
485499977
0
176542595
151335580
127791289
163010768
...

result:


Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%