QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#402702#2560. Streetlightsjxy2012TL 4423ms61076kbC++1711.1kb2024-05-01 11:16:522024-05-01 11:16:52

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 9ms
memory: 31664kb

input:

6 2
4 2 2 2 4 6
4 6
6 4

output:

3
2
2

result:

ok 3 lines

Test #2:

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

input:

50 100
310081863 722273055 654741011 310081863 654741011 722273055 654741011 722273055 654741011 654741011 654741011 310081863 310081863 722273055 654741011 654741011 654741011 722273055 310081863 654741011 310081863 310081863 310081863 722273055 310081863 654741011 654741011 310081863 722273055 722...

output:

28
28
28
29
30
31
31
31
31
31
31
31
31
32
33
34
34
33
33
33
33
32
32
31
31
31
32
32
31
31
31
31
30
30
30
31
31
31
31
31
31
30
30
29
30
31
32
32
32
32
32
31
32
33
33
33
33
32
32
31
32
33
31
31
32
31
32
31
31
31
30
31
30
29
29
28
28
29
28
28
27
27
27
27
27
27
26
27
28
27
28
29
28
28
28
28
29
29
28
29
28

result:

ok 101 lines

Test #3:

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

input:

50 100
93308794 275481889 130830018 675774101 130830018 93308794 275481889 999873895 275481889 104418887 130830018 275481889 675774101 999873895 130830018 841188804 360486542 104418887 140762403 275481889 275481889 770511267 104418887 140762403 93308794 675774101 104418887 770511267 130830018 933087...

output:

12
12
11
11
11
11
11
11
10
10
10
10
10
10
10
11
11
11
11
12
12
12
12
12
11
10
11
11
11
11
11
12
13
12
12
13
13
14
12
11
11
10
10
10
10
10
9
9
9
9
9
9
8
9
10
10
9
10
9
9
9
10
10
11
12
12
13
13
13
13
14
14
13
13
13
12
12
12
12
13
12
12
12
12
12
12
13
13
13
13
15
15
15
17
18
18
17
17
16
16
15

result:

ok 101 lines

Test #4:

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

input:

50 100
195248019 905127308 129122336 764519854 338556860 795943323 554412442 338556860 217191782 140699690 654772489 386182517 217191782 37485244 795943323 924638428 795943323 820028162 855279832 795943323 129122336 554412442 195248019 764519854 810525122 554412442 201706134 661330059 129122336 2090...

output:

5
5
6
5
5
5
4
4
3
3
3
3
3
2
4
3
3
3
4
5
5
5
5
5
5
5
5
4
4
4
5
6
6
5
5
4
4
4
3
3
3
3
3
3
4
4
4
4
3
3
4
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
5
5
5
5
6
6
6
5
5
5
5
5
6
6
6
6
7
7
7
7
7
7
7
7
7
7
7
7
7
7
8
8
8
7

result:

ok 101 lines

Test #5:

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

input:

50 100
772094573 19576803 263817454 873867094 557813690 952336439 500513802 392057352 305209480 199018938 206776586 514630037 466387810 403552086 50423285 658534934 19576803 404488754 179660945 591777562 262850065 817419372 680762089 591777562 424021147 403552086 718896141 456431927 680762089 595426...

output:

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

result:

ok 101 lines

Test #6:

score: 0
Accepted
time: 7ms
memory: 31780kb

input:

50 100
5096114 61078240 254964021 318250156 571031769 256037951 208426954 833646260 732869624 746606948 226729785 151221431 611264696 351005299 205027954 706057630 453231547 874058912 462474957 366832522 823051853 289489922 109072951 103985450 269915659 377686154 809672410 12123621 732787174 9017273...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 101 lines

Test #7:

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

input:

50 100
976187983 976187983 879080743 976187983 827737130 827737130 827737130 827737130 815905933 811453113 789018592 789018592 681089922 675640665 659464656 635119734 635119734 633485638 633485638 567930339 552957008 484438465 484438465 484438465 387753272 377659696 376161946 976187983 367642977 376...

output:

16
15
14
14
15
16
17
17
18
18
31
30
29
28
27
26
25
24
23
22
21
20
20
19
20
19
18
18
18
18
18
17
17
16
16
16
16
15
15
15
15
14
13
12
12
12
12
11
11
10
9
9
9
8
8
7
7
6
7
6
7
7
7
8
8
7
8
10
10
10
10
10
11
10
10
12
14
15
15
16
16
15
16
18
19
20
26
26
27
28
29
28
28
27
26
25
24
23
23
22
21

result:

ok 101 lines

Test #8:

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

input:

50 100
843864537 245114944 227661173 137675097 918583745 80278395 44678681 37169219 37007425 27167524 4382795 4043558 3655016 3624538 2994987 1979195 1407769 819862 771067 665903 137891 137891 665903 771067 819862 1407769 1979195 2994987 3624538 3655016 4043558 4382795 27167524 37007425 37142735 305...

output:

17
17
16
15
7
7
8
5
5
5
5
5
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
0
0
0
1
1
2
3
3
4
4
4
4
5
6
6
7
8
9
10
11
12
13
14
14
14
14
14
15
16
16
16
16
17
18
19
19
20
21
20
19
18
15
14
14
14
13
7
6
6
6
6
6
6
6
6
6
6
5
5
4
4
4
3
3
3
3
3
3
2
2
2
2

result:

ok 101 lines

Test #9:

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

input:

50 100
920202355 768392166 755066475 630812635 617367313 601334965 450742259 367726734 265094786 151773018 77676966 53524889 53524889 77676966 151773018 265094786 205222950 154745305 57476426 57476426 154745305 294856628 367726734 450742259 601334965 617367313 630812635 481253037 481253037 755066475...

output:

19
20
20
19
18
17
16
15
14
13
12
11
10
10
10
10
9
8
7
7
7
8
7
7
7
6
6
5
5
5
5
4
4
3
3
4
3
3
3
3
3
3
3
3
2
2
3
3
3
3
3
4
4
5
5
5
6
6
6
6
8
10
10
11
12
13
13
14
14
15
15
15
20
21
22
21
19
17
17
17
15
14
13
13
13
13
13
12
12
11
10
8
8
8
8
7
7
7
7
7
7

result:

ok 101 lines

Test #10:

score: 0
Accepted
time: 2581ms
memory: 58016kb

input:

100000 250000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 1...

output:

99296
99297
99298
99299
99301
99302
99304
99306
99307
99308
99310
99312
99313
99314
99315
99317
99318
99319
99320
99321
99322
99323
99324
99326
99327
99329
99330
99332
99333
99334
99335
99337
99338
99339
99341
99343
99345
99347
99348
99349
99350
99351
99353
99354
99355
99356
99357
99358
99359
99360
...

result:

ok 250001 lines

Test #11:

score: 0
Accepted
time: 2469ms
memory: 59540kb

input:

100000 250000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 1...

output:

99990
99982
99981
99985
99990
99986
99985
99989
99990
99989
99982
99983
99990
99987
99984
99985
99990
99985
99984
99985
99990
99982
99981
99984
99990
99988
99985
99986
99990
99986
99981
99982
99990
99982
99981
99986
99990
99987
99984
99985
99990
99982
99981
99984
99990
99983
99981
99982
99990
99989
...

result:

ok 250001 lines

Test #12:

score: 0
Accepted
time: 2482ms
memory: 60532kb

input:

100000 250000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 1...

output:

99990
99988
99987
99989
99990
99984
99981
99982
99990
99986
99981
99982
99990
99989
99985
99986
99990
99987
99980
99981
99990
99985
99981
99982
99990
99985
99982
99983
99990
99986
99983
99984
99990
99987
99985
99986
99990
99989
99984
99985
99990
99985
99981
99982
99990
99983
99982
99989
99990
99987
...

result:

ok 250001 lines

Test #13:

score: 0
Accepted
time: 2452ms
memory: 60132kb

input:

100000 250000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 1...

output:

99990
99988
99980
99981
99990
99988
99987
99989
99990
99985
99984
99985
99990
99988
99984
99985
99990
99988
99987
99989
99990
99985
99982
99983
99990
99983
99982
99984
99990
99982
99981
99988
99990
99987
99981
99982
99990
99986
99983
99984
99990
99983
99982
99986
99990
99981
99980
99983
99990
99989
...

result:

ok 250001 lines

Test #14:

score: 0
Accepted
time: 2410ms
memory: 61076kb

input:

100000 250000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 1...

output:

99990
99985
99980
99981
99990
99983
99982
99983
99990
99983
99982
99989
99990
99983
99982
99983
99990
99989
99985
99986
99990
99989
99985
99986
99990
99985
99980
99981
99990
99984
99981
99982
99990
99984
99983
99987
99990
99989
99981
99982
99990
99989
99984
99985
99990
99985
99984
99989
99990
99989
...

result:

ok 250001 lines

Test #15:

score: 0
Accepted
time: 884ms
memory: 45612kb

input:

100000 85453
662004428 662004428 662004428 662004428 285389268 662004428 662004428 662004428 662004428 662004428 662004428 662004428 662004428 662004428 662004428 662004428 662004428 662004428 285389268 662004428 662004428 662004428 285389268 662004428 662004428 285389268 662004428 662004428 6620044...

output:

87530
87530
87529
87528
87528
87527
87527
87526
87525
87525
87524
87523
87522
87523
87523
87523
87522
87521
87520
87519
87519
87518
87517
87516
87515
87514
87513
87512
87511
87510
87510
87509
87509
87508
87507
87507
87507
87506
87505
87504
87503
87503
87502
87501
87500
87499
87498
87497
87496
87496
...

result:

ok 85454 lines

Test #16:

score: 0
Accepted
time: 1396ms
memory: 51380kb

input:

100000 130170
687775446 687775446 687775446 687775446 687775446 687775446 687775446 687775446 687775446 687775446 687775446 687775446 66131936 687775446 687775446 153170868 687775446 687775446 153170868 687775446 153170868 687775446 687775446 687775446 687775446 687775446 687775446 687775446 6877754...

output:

82091
82091
82090
82089
82088
82087
82086
82085
82084
82083
82082
82081
82080
82079
82079
82079
82078
82077
82076
82075
82074
82074
82073
82072
82071
82070
82069
82068
82067
82066
82065
82064
82065
82065
82064
82063
82062
82061
82060
82059
82058
82057
82056
82055
82055
82054
82054
82054
82053
82053
...

result:

ok 130171 lines

Test #17:

score: 0
Accepted
time: 2709ms
memory: 58776kb

input:

100000 250000
986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 986692197 286706529 263144019 263144019 513324265 986692197 986692197 986692197 986692197 263144019 112713891 986692197 986692197 986692...

output:

72113
72112
72111
72110
72110
72109
72108
72107
72106
72106
72106
72106
72105
72104
72104
72103
72103
72103
72102
72101
72101
72100
72099
72098
72097
72096
72095
72094
72093
72092
72091
72090
72090
72090
72089
72089
72088
72088
72088
72088
72087
72086
72085
72084
72083
72082
72081
72080
72079
72078
...

result:

ok 250001 lines

Test #18:

score: 0
Accepted
time: 2802ms
memory: 58696kb

input:

100000 250000
259412947 915441273 915441273 915441273 915441273 915441273 915441273 915441273 41568879 915441273 41568879 915441273 915441273 915441273 915441273 915441273 915441273 915441273 915441273 915441273 915441273 786625775 915441273 915441273 915441273 915441273 915441273 915441273 91544127...

output:

70293
70292
70291
70291
70290
70289
70288
70287
70287
70286
70286
70285
70284
70283
70282
70281
70280
70279
70278
70278
70278
70277
70276
70276
70275
70275
70274
70274
70273
70273
70273
70272
70271
70270
70269
70268
70267
70266
70265
70264
70263
70262
70261
70260
70259
70258
70257
70256
70256
70255
...

result:

ok 250001 lines

Test #19:

score: 0
Accepted
time: 2797ms
memory: 60080kb

input:

100000 250000
972766086 972766086 972766086 235311221 972766086 730052587 972766086 194240551 173272584 972766086 832962158 730052587 972766086 972766086 730052587 972766086 972766086 972766086 972766086 173272584 972766086 962996883 972766086 972766086 972766086 972766086 304469796 972766086 972766...

output:

69540
69539
69538
69538
69537
69536
69536
69535
69534
69534
69533
69532
69531
69530
69530
69531
69531
69531
69530
69530
69529
69528
69527
69527
69526
69525
69524
69524
69523
69522
69521
69520
69519
69518
69517
69516
69515
69514
69513
69513
69512
69512
69511
69510
69509
69508
69507
69506
69506
69506
...

result:

ok 250001 lines

Test #20:

score: 0
Accepted
time: 2895ms
memory: 58992kb

input:

100000 250000
154807547 918756403 953813422 619806450 953813422 953813422 953813422 953813422 953813422 953813422 953813422 953813422 953813422 953813422 953813422 420454628 953813422 866134938 953813422 953813422 953813422 360533231 20081630 953813422 953813422 953813422 953813422 953813422 9538134...

output:

68574
68574
68574
68573
68572
68571
68570
68569
68569
68568
68567
68566
68566
68565
68564
68563
68562
68561
68560
68559
68558
68557
68556
68556
68556
68556
68555
68555
68555
68555
68554
68554
68553
68553
68553
68552
68551
68550
68549
68548
68547
68546
68545
68544
68543
68543
68542
68542
68542
68542
...

result:

ok 250001 lines

Test #21:

score: 0
Accepted
time: 3021ms
memory: 57844kb

input:

100000 250000
852602535 249311522 976091974 627509820 64210097 976091974 976091974 976091974 617299575 976091974 349688741 118611971 581831340 976091974 555461910 434601718 976091974 976091974 976091974 64210097 976091974 976091974 976091974 765558531 976091974 976091974 976091974 976091974 97609197...

output:

67872
67871
67870
67869
67869
67868
67868
67867
67867
67866
67865
67865
67865
67864
67863
67863
67862
67861
67860
67859
67858
67857
67856
67855
67854
67853
67853
67854
67853
67852
67851
67850
67849
67849
67848
67847
67846
67845
67844
67844
67843
67844
67843
67842
67841
67840
67840
67839
67838
67837
...

result:

ok 250001 lines

Test #22:

score: 0
Accepted
time: 3144ms
memory: 57840kb

input:

100000 250000
984228313 984228313 984228313 984228313 984228313 984228313 740791129 984228313 984228313 140209594 984228313 984228313 984228313 379857068 984228313 984228313 984228313 867403878 680442778 984228313 680442778 984228313 365412827 965277635 984228313 984228313 984228313 984228313 984228...

output:

67031
67030
67030
67029
67029
67028
67027
67026
67025
67024
67024
67023
67023
67022
67021
67020
67020
67019
67018
67018
67017
67016
67015
67014
67013
67012
67011
67011
67010
67009
67009
67008
67007
67006
67005
67005
67004
67004
67003
67002
67002
67002
67002
67001
67001
67001
67000
66999
66998
66997
...

result:

ok 250001 lines

Test #23:

score: 0
Accepted
time: 4423ms
memory: 59240kb

input:

100000 250000
715257169 997296570 997296570 542312762 997296570 997296570 27873846 302224626 87347482 997296570 401624705 471054633 829392280 997296570 997296570 846504156 789999894 997296570 745260120 997296570 997296570 772173017 997296570 997296570 11575993 198643972 997296570 997296570 43349906 ...

output:

66442
66441
66441
66440
66439
66438
66438
66437
66437
66436
66435
66435
66434
66433
66433
66432
66431
66430
66430
66429
66428
66427
66427
66427
66426
66425
66424
66423
66423
66422
66421
66420
66420
66419
66419
66419
66418
66418
66417
66416
66416
66415
66414
66413
66412
66411
66411
66410
66410
66409
...

result:

ok 250001 lines

Test #24:

score: -100
Time Limit Exceeded

input:

100000 250000
999986079 999986079 999986079 999986079 103890029 999986079 999986079 999986079 999986079 650871372 999986079 292720648 974802302 999986079 999986079 999986079 999986079 26228771 294305020 290616853 999986079 999986079 999986079 999986079 999986079 461483689 436031264 999986079 9999860...

output:


result: