QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#351601#6140. 矩阵游戏dXqwq100 ✓122ms7036kbC++232.1kb2024-03-12 08:12:012024-03-12 08:12:01

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 5
Accepted
time: 0ms
memory: 3796kb

input:

10
3 3
9 21
22 16
3 3
28 30
13 4
3 3
17 10
5 30
3 3
30 27
30 25
3 3
22 19
28 12
3 3
30 27
21 28
3 3
4 25
11 5
3 3
12 24
24 30
3 3
5 4
27 8
3 3
20 29
17 18

output:

YES
9 0 21 
0 0 0 
6 16 0 
YES
28 0 30 
0 0 0 
9 4 0 
YES
17 0 10 
0 0 0 
0 5 25 
YES
30 0 27 
0 0 0 
5 25 0 
YES
22 0 19 
0 0 0 
16 12 0 
YES
30 0 27 
0 0 0 
0 21 7 
YES
4 0 25 
0 0 0 
6 5 0 
YES
12 0 24 
0 0 0 
0 24 6 
YES
5 0 4 
0 0 0 
19 8 0 
YES
20 0 29 
0 0 0 
0 17 1 

result:

ok you are right!!

Test #2:

score: 5
Accepted
time: 0ms
memory: 5784kb

input:

10
3 3
5 18
16 21
3 3
28 30
27 5
3 3
30 12
9 11
3 3
28 20
30 13
3 3
22 27
28 5
3 3
30 29
30 23
3 3
17 13
22 13
3 3
29 24
29 25
3 3
23 12
3 2
3 3
20 30
23 30

output:

YES
5 0 18 
0 0 0 
0 16 5 
YES
28 0 30 
0 0 0 
22 5 0 
YES
30 0 12 
0 0 0 
0 9 2 
YES
28 0 20 
0 0 0 
17 13 0 
YES
22 0 27 
0 0 0 
23 5 0 
YES
30 0 29 
0 0 0 
7 23 0 
YES
17 0 13 
0 0 0 
9 13 0 
YES
29 0 24 
0 0 0 
4 25 0 
YES
23 0 12 
0 0 0 
1 2 0 
YES
20 0 30 
0 0 0 
0 23 7 

result:

ok you are right!!

Test #3:

score: 5
Accepted
time: 1ms
memory: 5848kb

input:

10
3 3
17 22
17 27
3 3
30 24
30 30
3 3
11 16
10 15
3 3
29 18
19 27
3 3
12 2
25 26
3 3
27 28
29 30
3 3
14 11
8 16
3 3
29 27
26 15
3 3
1 21
25 12
3 3
30 28
21 27

output:

YES
17 0 22 
0 0 0 
0 17 10 
YES
30 0 24 
0 0 0 
0 30 0 
YES
11 0 16 
0 0 0 
0 10 5 
YES
29 0 18 
0 0 0 
0 19 8 
YES
12 0 2 
0 0 0 
0 25 1 
YES
27 0 28 
0 0 0 
0 29 1 
YES
14 0 11 
0 0 0 
0 8 8 
YES
29 0 27 
0 0 0 
11 15 0 
YES
1 0 21 
0 0 0 
13 12 0 
YES
30 0 28 
0 0 0 
0 21 6 

result:

ok you are right!!

Test #4:

score: 5
Accepted
time: 1ms
memory: 5768kb

input:

10
3 3
6 30
30 11
3 3
29 28
11 25
3 3
26 26
15 22
3 3
23 30
29 6
3 3
16 8
13 20
3 3
26 30
29 28
3 3
3 24
4 2
3 3
29 30
24 29
3 3
15 12
7 4
3 3
30 26
25 30

output:

YES
6 0 30 
0 0 0 
19 11 0 
YES
29 0 28 
0 0 0 
0 11 14 
YES
26 0 26 
0 0 0 
0 15 7 
YES
23 0 30 
0 0 0 
23 6 0 
YES
16 0 8 
0 0 0 
0 13 7 
YES
26 0 30 
0 0 0 
1 28 0 
YES
3 0 24 
0 0 0 
2 2 0 
YES
29 0 30 
0 0 0 
0 24 5 
YES
15 0 12 
0 0 0 
3 4 0 
YES
30 0 26 
0 0 0 
0 25 5 

result:

ok you are right!!

Test #5:

score: 5
Accepted
time: 0ms
memory: 3760kb

input:

10
10 2
240
8788
3257
6676
9748
4941
1268
2569
7827
10 2
9542
9328
8351
9362
9771
9183
8527
8640
7370
10 2
3144
7704
2054
9901
3567
120
2273
2407
4202
10 2
7337
9013
9119
9547
8526
8071
8475
6682
9273
10 2
746
9791
1891
3204
8908
1495
1353
9406
1176
10 2
9884
6039
4691
9956
8516
9454
9649
8966
9380
...

output:

NO
YES
7048 0 
2494 0 
0 6834 
1517 0 
0 7845 
1926 0 
0 7257 
1270 0 
0 7370 
0 0 
NO
YES
6422 0 
915 0 
0 8098 
1021 0 
0 8526 
0 0 
0 8071 
404 0 
0 6278 
2995 0 
NO
YES
7096 0 
2788 0 
0 3251 
1440 0 
0 8516 
0 0 
0 9454 
195 0 
0 8771 
609 0 
NO
YES
8958 0 
0 0 
0 8441 
1184 0 
0 7886 
1159 0 
...

result:

ok you are right!!

Test #6:

score: 5
Accepted
time: 0ms
memory: 5784kb

input:

10
10 2
7221
6762
7271
4154
1804
3226
6434
8357
2359
10 2
8581
5933
9174
9731
9716
9180
8744
9947
6264
10 2
282
9689
7228
960
2522
6806
7516
7002
9829
10 2
9202
8816
8250
9267
8287
8105
9707
8985
9226
10 2
2004
254
7197
7613
9790
5556
3064
6363
6489
10 2
7863
9827
9600
9998
7626
6038
9530
8772
8501
...

output:

NO
YES
7688 0 
893 0 
0 5040 
4134 0 
0 5597 
4119 0 
0 5061 
3683 0 
0 6264 
0 0 
NO
YES
7656 0 
1546 0 
0 7270 
980 0 
0 8287 
0 0 
0 8105 
1602 0 
0 7383 
1843 0 
NO
YES
5264 0 
2599 0 
0 7228 
2372 0 
0 7626 
0 0 
0 6038 
3492 0 
0 5280 
3221 0 
NO
YES
6291 0 
1856 0 
0 7172 
0 0 
0 9481 
283 0 ...

result:

ok you are right!!

Test #7:

score: 5
Accepted
time: 1ms
memory: 5808kb

input:

10
10 2
2492
6642
8650
4949
7971
7552
5729
6137
3224
10 2
8862
4232
4370
9422
9787
8443
9745
9230
9708
10 2
1073
3311
5736
6108
1985
2880
2596
1260
4678
10 2
9862
9822
8867
4686
9645
7259
7954
9855
9482
10 2
6532
3248
1799
3767
7693
4389
5786
1124
9586
10 2
7667
9393
6828
8642
9482
8512
8366
7067
87...

output:

YES
2492 0 
0 0 
0 6642 
2008 0 
0 2941 
5030 0 
0 2522 
3207 0 
0 2930 
294 0 
YES
8862 0 
0 0 
0 4232 
138 0 
0 9284 
503 0 
0 7940 
1805 0 
0 7425 
2283 0 
NO
YES
8907 0 
955 0 
0 8867 
0 0 
0 4686 
4959 0 
0 2300 
5654 0 
0 4201 
5281 0 
NO
YES
5102 0 
2565 0 
0 6828 
0 0 
0 8642 
840 0 
0 7672 ...

result:

ok you are right!!

Test #8:

score: 5
Accepted
time: 0ms
memory: 4256kb

input:

10
100 2
407406
741582
966880
693984
175204
991130
183615
326373
131306
366816
697972
180227
398068
835836
746523
999640
178807
545159
437329
536071
721606
306737
181599
455551
733444
231865
77996
588988
897019
804401
528918
524503
349494
623245
534144
344637
25518
791164
100668
547254
630911
346372...

output:

NO
YES
647283 0 
102846 0 
0 747501 
134576 0 
0 781948 
212413 0 
0 766133 
184288 0 
0 659865 
16206 0 
0 593438 
0 0 
0 421730 
265080 0 
0 276696 
666339 0 
0 318563 
458439 0 
0 196118 
666359 0 
0 239005 
357928 0 
0 466265 
451156 0 
0 131492 
861478 0 
0 137602 
458038 0 
0 462088 
399664 0 ...

result:

ok you are right!!

Test #9:

score: 5
Accepted
time: 1ms
memory: 6020kb

input:

10
100 2
514849
121431
445450
996530
912655
547635
39581
89505
975458
843069
273144
700881
59053
289340
848708
32178
700710
194859
273472
213196
384827
341987
482545
308239
413944
599935
848280
843825
979288
195213
209986
440149
934390
768000
882462
200861
119570
174661
871708
511415
426500
576587
5...

output:

NO
YES
695456 0 
298080 0 
0 498364 
500209 0 
0 361888 
433407 0 
0 479661 
497781 0 
0 238111 
761888 0 
0 170139 
762822 0 
0 181915 
722759 0 
0 184148 
741213 0 
0 156111 
839902 0 
0 110472 
742142 0 
0 243932 
498709 0 
0 439158 
244278 0 
0 640848 
234542 0 
0 349106 
649644 0 
0 79504 
5362...

result:

ok you are right!!

Test #10:

score: 5
Accepted
time: 1ms
memory: 6016kb

input:

10
100 2
650385
567657
465159
181316
696069
211308
655715
128129
988551
838473
44280
61031
528962
277047
286263
142130
248066
307713
578918
695526
89569
48119
569157
673222
295474
923221
90394
912892
523136
369133
635906
272262
887296
438346
625250
217263
729637
256075
898161
999382
845113
626531
74...

output:

NO
YES
997572 0 
0 0 
0 831313 
140282 0 
0 842484 
130157 0 
0 481725 
160423 0 
0 809914 
126258 0 
0 313950 
227108 0 
0 721150 
198312 0 
0 629558 
323356 0 
0 319434 
635666 0 
0 333253 
202906 0 
0 133199 
607576 0 
0 229778 
728527 0 
0 202508 
457123 0 
0 399237 
337800 0 
0 313915 
534342 0...

result:

ok you are right!!

Test #11:

score: 5
Accepted
time: 44ms
memory: 6776kb

input:

10
300 298
0 0 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 0 1 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0...

output:

NO
YES
1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0...

result:

ok you are right!!

Test #12:

score: 5
Accepted
time: 121ms
memory: 6824kb

input:

10
297 296
0 0 1 0 1 0 1 0 1 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 1 1 0 0 1 1 0 1 1 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 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 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0...

result:

ok you are right!!

Test #14:

score: 5
Accepted
time: 122ms
memory: 6544kb

input:

10
298 299
0 1 0 1 1 1 1 1 1 0 0 1 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 0 0 0 1 1 1 0 1 0 1 1 1 0 0 0 1 0 0 1 0 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 1 1 0...

output:

NO
YES
0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0...

result:

ok you are right!!

Test #15:

score: 5
Accepted
time: 38ms
memory: 6660kb

input:

10
298 296
0 1 1 1 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 1 1 1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1...

output:

NO
YES
1 0 0 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0...

result:

ok you are right!!

Test #16:

score: 5
Accepted
time: 69ms
memory: 6548kb

input:

10
295 299
3600561 469227 1519243 508870 2714139 2548515 3416122 1633507 1829918 1551817 3098121 1670950 2106466 1946727 1581396 3426393 1988045 2888135 2146489 1534631 2721599 3729764 456043 293501 882439 3099151 2941143 3610816 549774 1066237 3189705 2413286 2316602 3976215 3845403 862960 241887 2...

output:

NO
YES
80779 336985 927788 343293 230163 269221 748535 734060 1000000 484753 102624 383891 350513 256902 39959 278316 697768 544851 681938 155281 791912 302141 843186 938745 737547 541704 349981 314588 496006 0 84637 794453 703189 209898 920715 882526 715561 234710 590151 195375 694888 434234 922447...

result:

ok you are right!!

Test #17:

score: 5
Accepted
time: 68ms
memory: 6536kb

input:

10
298 297
1203979 2459461 1123626 2165742 593951 2361185 60882 1597698 966249 1407808 2665213 1585110 1730464 732707 2642476 54357 96750 3459440 500455 1509802 2084769 1885656 824649 1394960 3065480 1964072 626742 582644 617926 652074 1646286 250370 1154127 1955950 327344 753408 2005921 2832519 933...

output:

NO
YES
537296 917537 213326 40399 405187 541499 457580 553516 561720 257024 173528 546153 586576 9951 735575 603039 997511 711669 346512 265703 331446 639337 239191 405052 241442 429852 270819 16402 537346 376224 886164 333574 842524 738859 818776 233551 47557 747491 166794 477232 757761 961533 2499...

result:

ok you are right!!

Test #18:

score: 5
Accepted
time: 65ms
memory: 6960kb

input:

10
296 296
2917992 3146628 3606537 755096 2325656 3902232 2435726 2851482 3134088 1183312 3680091 2970485 3974463 2456731 3306154 400789 1137399 1266637 1849976 2126197 1039996 2867787 711979 2828033 1651264 3781772 1152035 2861694 2479767 1853717 886722 2972156 4583 903432 3364054 3947134 3871761 3...

output:

NO
YES
940104 324284 558582 202038 34640 831552 578163 82011 529320 698980 719894 677979 556454 389733 248351 394027 155938 337775 301788 341698 732033 514018 124850 324672 952259 743892 426920 88623 564301 204254 339173 551882 197378 0 542400 76473 876624 170441 935536 174363 855334 925125 116686 4...

result:

ok you are right!!

Test #19:

score: 5
Accepted
time: 65ms
memory: 6772kb

input:

10
297 297
13391 712464 2974864 1439202 1447544 1413180 800048 597109 3349875 2034207 1467293 796338 2354278 171222 1066675 2532591 208592 123178 2912280 3309432 3409173 1029236 2315777 2135394 3355241 69077 3113692 2937527 2948148 1151724 1640840 870814 42569 2304251 726055 3017332 2049772 2646010 ...

output:

NO
YES
365742 152977 514917 756146 815474 792720 793191 0 813407 820087 108269 691197 229856 681718 274830 159148 994014 925929 345364 41381 920390 245729 548192 58412 662178 308717 42426 424370 908848 327241 974604 293492 357602 703820 53973 431964 583519 330452 142643 624864 837243 774942 550265 1...

result:

ok you are right!!

Test #20:

score: 5
Accepted
time: 65ms
memory: 7036kb

input:

10
297 295
2251173 2102586 854138 210476 3746962 1050335 357886 1246625 2048656 3914401 2622120 2500826 3210040 3638713 646704 3538951 2675262 2202513 1600647 2451535 120429 782584 3574033 3344068 580591 2179489 3256587 684504 1805546 599720 3155847 2286982 2960267 502472 3365334 1420188 2393737 228...

output:

NO
YES
326665 819904 413275 578084 169128 808113 972449 0 529912 950084 932117 550899 588480 782446 373526 210467 498247 752420 499183 87110 833865 571528 160623 975697 732262 983404 801953 339533 408572 758907 669125 607213 491035 545987 277456 0 626977 99329 398736 343956 354992 674763 279314 9095...

result:

ok you are right!!

Extra Test:

score: 0
Extra Test Passed