QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#455473#105. Simple gameZhaoZiLong49 239ms20424kbC++201.2kb2024-06-26 14:43:162024-06-26 14:43:16

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 22
Accepted

Test #1:

score: 22
Accepted
time: 3ms
memory: 19388kb

input:

3 3
1 5 1
2 3
1 1 5
2 3

output:

2
1

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 213ms
memory: 19328kb

input:

1000 1000
403944 539844 451514 488113 693733 651613 563358 916918 605393 909558 657949 170748 659971 389016 826009 517990 412996 904989 357541 151208 802899 615350 245323 574670 586084 779493 509446 634227 113180 158403 598536 396554 496919 395067 849333 498457 288483 246925 615590 137465 97346 5881...

output:

444
462
34
516
288
400
438
492
100
515
268
514
446
456
216
442
510
204
512
276
236
454
264
102
186
428
62
470
505
242
364
519
158
238
298
300
178
108
252
514
166
84
424
334
506
410
382
208
212
446
517
224
384
274
42
342
514
464
348
192
150
342
126
186
495
442
290
508
464
450
510
505
491
440
194
62
5...

result:

ok 500 lines

Test #3:

score: 0
Accepted
time: 228ms
memory: 19308kb

input:

1000 1000
487368 55984 456259 117591 818795 130390 526829 133610 539549 246445 951093 697788 460061 958553 20524 222803 693422 185251 755559 448153 90840 763128 128640 416349 932645 865509 827859 26384 827493 458273 309250 649929 806506 371204 684146 836161 123213 444296 235532 894872 313447 206287 ...

output:

440
400
480
130
38
388
404
489
428
485
318
218
352
480
476
168
178
486
438
478
260
483
482
378
230
164
194
174
340
104
476
312
486
46
36
126
100
264
248
98
316
296
230
310
424
300
490
422
467
70
422
390
298
34
474
332
481
426
308
488
320
72
110
354
235
78
323
440
262
229
489
280
457
388
404
397
222
...

result:

ok 500 lines

Test #4:

score: 0
Accepted
time: 216ms
memory: 19300kb

input:

1000 1000
570792 604828 236813 971260 135345 576462 298812 284894 506408 550627 211533 257531 227447 784987 990847 670720 165337 657002 186281 488202 154588 943609 236149 323436 246502 208422 922081 708141 317613 533952 828477 160199 181501 314636 518959 206569 957942 674371 822770 428086 786444 791...

output:

386
460
50
470
126
26
468
384
146
519
310
20
450
56
482
150
416
338
144
412
360
390
434
468
204
414
330
510
486
514
304
472
322
2
521
418
246
460
196
513
514
400
450
288
198
519
110
414
204
316
158
198
194
250
452
282
468
106
454
138
414
368
34
144
514
308
505
162
472
424
500
114
442
14
502
514
106
...

result:

ok 500 lines

Test #5:

score: 0
Accepted
time: 226ms
memory: 19464kb

input:

1000 1000
686920 120969 241559 600738 484598 279431 103500 501586 473268 854809 471972 560379 60241 354524 185362 118637 445763 904560 617004 785147 218337 867195 343659 389307 560359 551334 16302 133002 31925 768414 347703 446278 491088 290772 288364 833874 792672 871742 410007 218197 2545 185620 4...

output:

330
306
418
290
136
340
224
84
426
418
324
461
290
276
278
434
494
186
214
72
370
434
430
424
228
427
422
126
314
104
398
388
326
314
114
422
362
477
412
102
270
465
334
282
506
10
258
392
450
394
427
382
124
451
240
124
344
256
518
512
108
510
308
4
198
386
426
222
254
508
512
24
90
326
494
294
394...

result:

ok 500 lines

Test #6:

score: 0
Accepted
time: 239ms
memory: 19368kb

input:

1000 1000
737640 478325 54816 262919 609660 758208 66971 909766 407423 126288 732412 152827 860332 180957 155685 566554 693485 376310 47726 49387 506277 14973 451168 263690 874216 637350 110523 525159 746238 68284 91121 956548 576484 234205 347369 171578 660106 101817 997245 975604 410133 803734 209...

output:

230
418
148
338
4
441
510
186
387
212
318
418
184
482
118
510
278
418
500
480
406
464
130
82
246
198
497
461
355
288
112
431
521
491
495
493
451
501
395
499
176
519
118
112
343
427
497
509
178
469
509
234
78
513
491
134
305
517
481
291
345
411
338
194
509
493
160
491
469
118
497
395
305
499
377
305
...

result:

ok 500 lines

Test #7:

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

input:

1000 1000
1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 1 1000000 ...

output:

999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
...

result:

ok 1000 lines

Subtask #2:

score: 27
Accepted

Test #8:

score: 27
Accepted
time: 15ms
memory: 20268kb

input:

100000 100000
18 15 8 5 7 19 19 11 11 8 6 15 11 8 15 12 6 16 18 18 16 17 20 18 18 17 15 5 8 8 18 6 18 20 14 19 19 5 9 16 5 17 15 19 20 17 12 9 14 18 19 16 9 6 10 11 13 16 12 18 6 12 6 15 19 20 10 17 10 12 15 13 18 7 14 8 7 15 7 14 9 17 10 15 13 14 15 12 11 12 14 14 14 19 7 16 7 17 12 16 11 6 18 18 1...

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
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 100000 lines

Test #9:

score: 0
Accepted
time: 13ms
memory: 20316kb

input:

100000 100000
611680 625326 848926 304761 34686 696982 275897 392063 769779 97648 477956 908326 678227 975305 324587 445989 114055 568928 232496 23720 819209 270123 89065 357324 169130 404179 130496 333348 773133 109363 144114 336567 194409 437469 655441 966463 892042 498325 192834 391531 219600 734...

output:

30636
30745
50130
4464
9086
47043
41334
49040
49968
40968
45913
30688
38855
840
48754
6896
41115
2658
35926
17394
31093
38693
45522
42447
47342
25584
926
21204
48506
48938
44596
32697
29204
28487
9200
49694
14140
11356
31722
50040
45009
26502
43711
18410
32269
9824
48842
22450
49066
22264
45987
2302...

result:

ok 100000 lines

Test #10:

score: 0
Accepted
time: 16ms
memory: 20208kb

input:

100000 100000
695104 174171 853672 901534 351235 175759 47881 576051 769342 369127 705691 435366 478318 544842 551806 926611 361778 816486 695922 287961 882958 193709 196575 231707 482987 779795 192013 15105 487445 152337 663340 846837 536700 380901 424846 561063 726771 728400 780072 924745 435700 3...

output:

31870
39772
30788
11144
42732
17872
33875
15158
36182
45316
47798
30266
12804
45814
21926
30490
3204
20580
49888
15958
46132
43824
3100
50130
21818
32766
42471
22490
14726
33583
50216
39287
24618
50220
41716
46026
48282
41428
28186
1282
23618
45394
42254
156
34109
42294
43432
21176
45942
46726
32973...

result:

ok 100000 lines

Test #11:

score: 0
Accepted
time: 13ms
memory: 20424kb

input:

100000 100000
1 1 1 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 1 2 1 2 2 1 2 1 2 2 2 2 1 1 2 2 1 2 2 2 2 2 2 1 1 2 1 1 1 2 2 1 2 1 2 1 1 2 1 2 1 2 1 1 2 2 1 2 2 1 1 2 2 1 2 1 1 1 1 2 1 2 1 1 1 1 2 2 1 1 1 2 2 1 1 1 2 2 1 1 2 1 1 2 2 2 1 2 2 1 2 2 1 2 1 1 2 1 1 2 1 1 2 1 2 2 2 2 2 1 2 1 1 1 1 1 2 2 2 2 2 2 1 2 ...

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
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 100000 lines

Test #12:

score: 0
Accepted
time: 22ms
memory: 20268kb

input:

100000 100000
2845 22894 4105 11830 29440 21804 24593 9910 14938 21157 24268 10418 9470 15050 3826 9948 15110 14592 2236 15211 2172 24929 9640 25051 26304 5194 15624 28298 19336 20491 5587 17181 7787 23690 1267 8073 19782 1376 9046 11722 1623 14250 9310 5279 26997 18041 19681 8475 22437 22562 5529 2...

output:

45066
50090
24109
27778
294
44422
34690
49640
48910
27841
40956
45154
44522
48806
32334
34736
21047
6908
22098
23527
32756
46746
44044
43216
13954
5816
28681
50068
7090
48558
21855
49224
7510
22323
16208
17085
33148
7880
48952
29166
17741
45728
19435
39960
49368
48080
47020
49508
3548
4476
48654
268...

result:

ok 100000 lines

Subtask #3:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #13:

score: 0
Time Limit Exceeded

input:

100000 100000
123269 247698 241557 639404 387765 948914 460495 251584 959303 613156 222329 886960 433508 798929 160485 522976 927783 189816 503897 354632 527266 322665 831249 741938 98777 7947 372156 306688 452421 81111 713914 866403 371410 522650 218788 140965 323553 371639 362820 15073 133319 1591...

output:

37412
1520
46224
964
50058
46256
44458
22714
29000
30024
48378
46802
44502
27732
37086
46506
22429
32076
11058
31676
2330
35672
37032
50042
48246
49290
45714
50072
50070
42896
50028
5580
7258
47536
26260
638
14122
26538
31704
35260
22311
49770
31434
22890
35176
15648
49964
43850
3634
7614
42754
3885...

result: