QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#264288#4934. Forbidden CardZhaoZiLongWA 35ms84200kbC++203.2kb2023-11-25 13:32:262023-11-25 13:32:27

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 4ms
memory: 63148kb

input:

3 6
1 2
2 4
4 2

output:

3
0
3

result:

ok 3 lines

Test #2:

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

input:

4 10
1 5
2 6
3 7
4 8

output:

4
2
2
2

result:

ok 4 lines

Test #3:

score: 0
Accepted
time: 9ms
memory: 61176kb

input:

1 2
1 2

output:

2

result:

ok single line: '2'

Test #4:

score: 0
Accepted
time: 19ms
memory: 67932kb

input:

69332 250102
51362 228823
206751 31351
181790 44202
186695 92215
172072 173179
86663 76959
42382 25827
204750 30001
42502 11959
201030 71886
227497 216114
164282 235028
178967 181951
125356 20611
169528 174071
50985 175562
63676 208400
189134 229462
49746 131529
180236 247427
29278 229589
30381 4412...

output:

197458
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 69332 lines

Test #5:

score: 0
Accepted
time: 18ms
memory: 73692kb

input:

80145 426253
421996 34366
346502 239646
343011 88629
67397 242186
299496 244930
21243 104718
387596 328535
219758 313693
75331 382300
313805 77098
42577 148653
337458 118115
214642 386869
250381 179903
371620 42703
175776 57872
382478 385425
67153 363632
137021 301439
54496 28984
416540 87624
180610...

output:

2
2
387645
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 80145 lines

Test #6:

score: 0
Accepted
time: 28ms
memory: 80104kb

input:

100000 1000000
123135 548518
73705 792839
425849 331898
823140 91484
612409 674530
215766 587078
145133 904035
435464 107690
291461 358251
156778 270843
378425 339959
353997 687100
373365 903063
948343 203641
349073 91866
329756 348161
731516 202789
767371 938875
3496 388919
998073 384450
73693 8551...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
956616
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 #7:

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

input:

89069 799019
589538 728126
669934 721110
689804 767765
57113 349607
788143 621300
449778 648433
451910 356399
484000 586091
699836 387252
618498 221963
42563 549795
774972 697895
765784 478517
626296 213965
174994 617652
788312 418305
509601 717678
663049 769953
167726 375932
38772 144093
140904 564...

output:

2
783305
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 89069 lines

Test #8:

score: 0
Accepted
time: 25ms
memory: 76596kb

input:

69694 877503
863663 582574
192540 50718
545855 600725
106914 337076
95953 472303
337876 352481
617099 663754
658298 249330
575057 97722
522140 520920
811913 519974
533217 425142
590101 532180
684733 355462
783334 274412
25380 75797
853682 128592
457036 274558
184076 7863
688088 614343
733047 768004
...

output:

2
2
829210
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 69694 lines

Test #9:

score: 0
Accepted
time: 21ms
memory: 75520kb

input:

68561 994844
934673 839086
678230 902049
609695 838139
172142 165310
166125 382300
733287 681492
31687 156593
743676 484561
301345 936945
511237 258689
936301 315735
750745 500110
650444 288851
407665 485171
316258 272455
868401 430224
348328 582450
368182 44256
934873 895495
466439 780819
543373 68...

output:

2
2
2
2
985873
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 68561 lines

Test #10:

score: 0
Accepted
time: 23ms
memory: 79856kb

input:

100000 1000000
750844 577520
750988 551898
71182 495851
781670 620811
429538 655630
949020 91780
352634 583957
278999 299878
401107 296003
310998 796093
134490 713012
571847 466126
97048 513189
701512 397675
328784 597378
600866 775036
123964 779641
783762 95052
581923 521272
174622 578127
940629 92...

output:

958024
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 #11:

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

input:

97613 571574
473117 229386
423786 319808
400816 515877
51984 283789
129404 223355
36594 363548
378401 286262
173741 481783
33072 245586
443684 222118
84885 277987
521174 139691
557463 541830
447714 163559
414047 64274
366005 384713
149976 525494
497204 378402
548917 82952
184725 168981
445716 501317...

output:

542823
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 97613 lines

Test #12:

score: 0
Accepted
time: 21ms
memory: 76796kb

input:

69396 864127
464385 526906
787104 491768
38269 47670
86820 517464
353813 728363
679809 387823
517990 116740
848791 410216
587334 99062
778991 733391
832499 522941
19242 176014
751019 345373
268829 384678
55782 16440
127010 333800
535423 588225
109371 645414
145244 552479
597799 552396
600038 235109
...

output:

2
2
2
2
2
2
2
805120
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 69396 lines

Test #13:

score: 0
Accepted
time: 18ms
memory: 70400kb

input:

86470 288956
81959 261040
206019 205310
130325 15327
223490 45996
254263 134493
132914 146198
271808 230093
192789 239059
257256 18045
87950 183011
19344 266027
280038 28560
139522 285325
26554 267570
4553 143311
21451 61963
242467 238366
274767 216559
165157 8502
185945 180806
271515 104078
98160 2...

output:

239234
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 86470 lines

Test #14:

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

input:

2 2
2 1
1 2

output:

0
2

result:

ok 2 lines

Test #15:

score: 0
Accepted
time: 35ms
memory: 84200kb

input:

100000 1000000
642133 546926
123679 867209
617137 454611
472705 627306
94896 603782
523279 31451
263895 276501
142151 455942
525514 977824
263586 220101
93152 998514
117325 54406
75166 160431
174093 514041
409869 356920
751904 244516
844806 816952
904840 872203
896272 387803
522151 434957
154934 531...

output:

2
3
2
2
2
2
3
2
2
908975
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 #16:

score: -100
Wrong Answer
time: 23ms
memory: 74740kb

input:

96191 790771
239246 406927
608723 39453
647021 455246
449613 325203
500412 246565
496412 527678
775691 306215
15686 145589
789951 122377
126343 302706
704644 254834
538536 278628
68976 439516
650659 690292
496323 588418
710462 6367
227229 387492
313599 215876
281669 237302
117764 311686
70133 388917...

output:

734096
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

result:

wrong answer 1st lines differ - expected: '0', found: '734096'