QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#463737#4316. pmrmscxipqiuzxAC ✓9018ms654100kbC++208.1kb2024-07-05 13:30:582024-07-05 13:30:59

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 6594ms
memory: 398992kb

input:

1000000 1000000
380 679 777 226 644 42 593 557 637 18 249 696 391 107 169 834 866 651 679 856 57 398 112 555 787 176 546 127 487 720 726 376 603 404 545 356 418 756 785 355 684 904 212 809 855 783 736 17 386 389 487 773 159 579 607 6 480 378 78 103 360 351 700 427 377 99 741 572 189 202 222 570 611 ...

output:

5543
1
8009
2140
3788
1
1
0
3799
3948
0
0
4527
2706
2060
1
1
4895
3569
0
1
1
1906
0
1
1
7513
0
0
824
2620
0
2699
1
1595
1
2826
2329
0
0
496
196
1
1
3761
5543
7513
1119
4498
2826
2180
265
1
1228
2822
8994
7513
3761
3761
427
4428
8994
0
0
1
4318
0
0
0
0
3569
0
5032
3193
0
1
2818
0
8994
1
3447
0
1
3574...

result:

ok 600294 lines

Test #2:

score: 0
Accepted
time: 5247ms
memory: 417084kb

input:

1000000 1000000
366 426 472 183 425 269 129 22 369 63 397 24 338 257 517 346 345 321 383 388 440 415 153 160 284 154 515 299 97 17 562 515 215 499 442 481 456 451 498 99 381 114 312 265 458 242 55 48 276 458 142 201 58 413 424 25 144 416 545 170 363 280 359 202 533 268 483 121 155 150 3 307 454 204 ...

output:

1
0
3809
1
0
3755
2517
0
0
1794
0
4007
0
0
1
2517
3025
3809
1
1
0
122
204
1852
1
1
3809
3809
0
0
0
1
1472
1558
1097
773
3809
491
3755
228
750
229
0
1
1
1
1396
1
4007
3809
3809
627
1
3809
1
857
0
0
857
3809
1073
2665
3809
0
3809
3243
2340
1
0
3809
3025
0
108
1536
2186
3809
3025
1
1
0
2432
1795
1
2725...

result:

ok 340568 lines

Test #3:

score: 0
Accepted
time: 5016ms
memory: 407360kb

input:

1000000 1000000
541159 630205 363352 227192 99958 296471 975613 252233 80475 167864 836828 184560 804755 920944 576350 202914 992777 227911 768340 897922 808870 227585 852752 389725 725117 606119 512884 901002 908921 621574 51105 341960 133213 287651 147511 904531 156337 772636 265996 148408 590582 ...

output:

94831
364157
1
21511
30275
312226
80166
70143
288395
2626
1
0
599886
98565
224972
10519
386182
6597
194321
277685
199886
417920
0
417920
124034
202410
417920
386374
0
417920
0
122597
396259
0
162795
0
417920
417920
1
170320
322059
37486
101891
99293
127561
325074
0
357374
0
417920
18114
37486
64241
...

result:

ok 400161 lines

Test #4:

score: 0
Accepted
time: 2489ms
memory: 280736kb

input:

1000000 1000000
478682 402589 343446 886390 519427 530835 920809 530746 264424 76914 220245 285386 423650 908771 30964 47856 299202 621549 380015 286899 519653 350008 13272 741730 464354 510706 527460 165532 332635 384850 269550 729279 812716 521816 984488 741626 495345 909549 828641 158485 163138 5...

output:

158037
1
1
38955
0
0
265180
35487
199902
0
0
0
240826
319830
1
0
3383
199012
31817
0
2339
632803
463676
43536
592975
654058
376089
124854
179136
97267
37883
37660
117981
280364
32583
337865
405391
0
189814
0
670814
631725
102503
523348
269032
0
0
512018
284712
0
0
95509
0
477618
504901
201653
239652...

result:

ok 930311 lines

Test #5:

score: 0
Accepted
time: 5802ms
memory: 380268kb

input:

999999 999997
305 420 87 845 139 246 742 802 492 255 570 292 405 90 341 148 324 875 840 393 476 604 109 484 598 517 273 22 604 459 524 489 611 497 8 731 43 124 841 807 334 846 116 410 429 67 230 808 540 175 296 435 75 848 827 469 896 663 592 636 207 542 617 567 589 562 362 108 689 727 304 675 429 58...

output:

6847
3498
0
1250
0
0
1
96
5287
758
1
0
1
5420
1995
3022
658
0
3159
0
0
6772
1682
470
4667
5411
1
2713
1
4303
152
2107
0
6772
6847
0
1
6452
3231
2522
6772
0
7045
333
1
6452
1745
6772
1
6772
1
0
1
1995
3498
1358
1
1988
0
4303
1
1
4303
0
231
2863
1
5287
0
1
1
2366
1
6452
4115
1
0
4824
2432
3310
1
4303
...

result:

ok 660468 lines

Test #6:

score: 0
Accepted
time: 8815ms
memory: 654100kb

input:

1000000 1000000
966844 792708 79445 826065 58907 359120 455041 821080 480002 482408 649383 987817 73459 866255 621855 769479 739703 370633 378741 305445 516311 759166 595734 851705 334917 203032 382423 67773 129354 768453 979877 167641 162497 421117 260710 501475 957715 991724 117045 477798 452959 8...

output:

0
1
1
1
431
1
1
0
1
1
1
39076
32171
1
0
1
0
1
1
1
1
1
0
0
1
0
1
0
1
0
21571
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
0
1
0
18306
1
1
0
15066
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
9072
1
1
1
1
1
1
0
1
0
0
1
0
1
1
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
0
4862
1
1
1
1
1
1
1
1
1
...

result:

ok 80404 lines

Test #7:

score: 0
Accepted
time: 9018ms
memory: 535520kb

input:

1000000 1000000
988810 735815 608532 420222 386157 890306 768406 657225 646210 315600 139962 932151 768827 984450 770731 453487 685598 543002 581870 552313 503972 177764 493840 25621 452770 179448 941470 104226 30789 573414 597085 789824 463108 197854 530800 848974 111409 970712 903459 212253 260725...

output:

1
1
1
1
1
54929
1
1
1
1
235784
32344
0
235784
1
1
1
1
1
141539
1
0
1
1
1
1
55919
1
1
1
179864
0
1
1
1
1
1
1
0
1
1
1
1
1
0
89912
1
1
55919
1
55919
1
1
0
1
179864
40867
1
1
1
1
1
1
1
1
1
0
1
1
0
1
1
115075
1
1
0
0
1
1
1
1
0
1
179864
115783
85395
0
1
1
1
0
1
0
0
1
1
0
1
1
1
0
1
1
0
1
1
1
1
1
1
179864
1...

result:

ok 569671 lines

Test #8:

score: 0
Accepted
time: 9010ms
memory: 487784kb

input:

1000000 999997
754737 382545 22625 954994 176479 904745 522195 954780 129554 460864 188166 177823 578535 615385 54905 733463 394448 693133 747012 65334 43823 106344 194190 129336 123404 33389 166630 520947 358644 905734 338275 13073 934015 6553 755842 760436 319861 87505 675549 627517 750211 667991 ...

output:

1
1
1
0
1
0
1
1
1
0
1
1
1
1
1
102801
143146
133046
1
0
1
0
1
143146
1
1
89418
1
1
1
1
1
1
1
1
1
0
1
0
1
0
1
1
1
85963
1
1
143146
143146
0
1
130758
1
1
0
0
0
110274
1
1
1
1
0
15621
1
116756
1
143146
0
0
0
0
1
1
1
1
143146
0
1
1
126754
1
1
0
143146
1
1
1
0
1
1
1
1
0
1
1
1
0
1
143146
1
1
83346
1
1
0
1
...

result:

ok 800084 lines

Test #9:

score: 0
Accepted
time: 4998ms
memory: 419224kb

input:

999999 999998
80 75 103 38 6 21 16 18 38 70 71 110 19 46 24 37 81 48 78 28 103 72 79 41 76 109 36 83 79 69 80 60 97 71 42 80 81 23 33 79 109 88 51 83 40 14 65 57 54 89 2 90 35 42 80 81 23 33 79 109 88 51 83 40 14 65 57 54 89 2 90 35 42 80 81 23 33 79 109 88 51 83 40 14 65 57 54 89 2 90 35 42 80 81 2...

output:

0
543
1
971
0
570
971
0
0
909
298
0
675
332
848
58
139
0
911
1
451
455
0
535
911
669
0
144
1
137
971
0
1139
1
1
224
257
269
1022
909
0
419
1
118
1
0
363
1
908
1
1
1
1
753
909
971
1
0
219
0
0
1
675
348
0
1
971
1143
0
909
30
811
269
1
1
0
0
282
114
1
0
1
911
0
152
1
1139
1
373
543
1
608
909
1
290
0
97...

result:

ok 220349 lines

Test #10:

score: 0
Accepted
time: 6346ms
memory: 310244kb

input:

1000000 1000000
9 10 16 28 11 33 10 22 13 15 20 21 7 33 13 31 25 20 14 22 22 19 1 2 23 35 18 22 19 16 23 23 24 248837 1 12 11 14 8 695844 12 34 32 26 32 35 10 28 12 24 18 1 17 29 1 28 5 32 6 5 32 21 33 5 17 3 7 24 12 21 25 15 11 9 9 35 27 19 7 33 26 14 37 36 15 34 13 7 2 32 23 4 16 17 135768 21 7 21...

output:

0
0
93
401
258
129
19
93
504
10
1
504
0
0
375
504
425
76
237
0
94
31
201
1
1
375
45
1
0
378
134
40
504
1
338
64
97
132
47
0
1
1
102
0
61
504
14
0
1
102
176
0
0
71
1
1
0
1
317
74
3
341
71
0
0
0
0
1
425
94
71
0
1
0
36
254
1
60
1
0
1
27
504
504
12
1
265
1
94
25
1
0
504
425
68
0
1
385
24
1
37
1
15
13
50...

result:

ok 979973 lines