QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#252017#7629. Make SYSU Great Again IIucup-team004AC ✓172ms18800kbC++201.4kb2023-11-15 14:38:462023-11-15 14:38:48

Judging History

你现在查看的是最新测评结果

  • [2023-11-15 14:38:48]
  • 评测
  • 测评结果:AC
  • 用时:172ms
  • 内存:18800kb
  • [2023-11-15 14:38:46]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int n;
    std::cin >> n;
    
    int k = 0;
    while ((1 << k) < n) {
        k += 1;
    }
    
    std::vector a(n, std::vector<int>(n));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if ((i + j) % 2 == 0) {
                int u = (i + j) / 2;
                int v = (i - j) / 2 + n / 2;
                a[i][j] = (u ^ (u >> 1)) << k | (v ^ (v >> 1));
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if ((i + j) % 2 == 1) {
                int x = 0;
                if (i) {
                    x |= a[i - 1][j];
                }
                if (j) {
                    x |= a[i][j - 1];
                }
                if (i < n - 1) {
                    x |= a[i + 1][j];
                }
                if (j < n - 1) {
                    x |= a[i][j + 1];
                }
                x ^= (1 << (2 * k)) - 1;
                a[i][j] = x;
            }
        }
    }
    std::cout << "Yes\n";
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            std::cout << a[i][j] << " \n"[j == n - 1];
        }
    }
    
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3428kb

input:

4

output:

Yes
3 8 5 2
8 7 0 13
6 0 15 0
1 14 0 11

result:

ok 1

Test #2:

score: 0
Accepted
time: 1ms
memory: 3480kb

input:

1

output:

Yes
0

result:

ok 1

Test #3:

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

input:

2

output:

Yes
1 0
0 3

result:

ok 1

Test #4:

score: 0
Accepted
time: 1ms
memory: 3388kb

input:

3

output:

Yes
1 10 4
8 5 2
7 0 13

result:

ok 1

Test #5:

score: 0
Accepted
time: 1ms
memory: 3368kb

input:

5

output:

Yes
3 52 9 38 24
52 11 36 25 38
10 36 27 36 17
33 26 36 19 12
30 33 18 12 51

result:

ok 1

Test #6:

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

input:

8

output:

Yes
6 49 10 36 27 36 17 14
48 14 33 26 36 19 12 49
15 32 30 33 18 12 51 4
32 31 32 22 9 50 4 59
29 32 23 8 54 1 58 4
34 21 8 55 0 62 1 42
20 10 53 0 63 0 46 17
11 52 2 61 0 47 16 38

result:

ok 1

Test #7:

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

input:

13

output:

Yes
5 232 23 200 54 201 34 156 99 140 113 142 80
234 21 200 55 200 38 153 98 140 115 140 81 174
20 202 53 200 39 152 102 137 114 140 83 172 65
195 52 202 37 152 103 136 118 137 82 172 67 60
60 195 36 154 101 136 119 136 86 169 66 60 195
194 44 147 100 138 117 136 87 168 70 57 194 44
45 146 108 131 1...

result:

ok 1

Test #8:

score: 0
Accepted
time: 1ms
memory: 3448kb

input:

21

output:

Yes
15 976 45 914 108 915 68 826 197 792 231 792 166 857 130 636 387 604 417 542 480
976 47 912 109 914 76 819 196 794 229 792 167 856 134 633 386 604 419 540 481 542
46 912 111 912 77 818 204 787 228 794 165 856 135 632 390 601 418 540 483 540 449
913 110 912 79 816 205 786 236 787 164 858 133 632 ...

result:

ok 1

Test #9:

score: 0
Accepted
time: 1ms
memory: 3492kb

input:

34

output:

Yes
25 4006 88 3879 200 3894 137 3700 395 3636 458 3633 334 3760 271 3312 781 3250 844 3123 964 3130 901 3192 647 3384 710 3385 578 3516 515 2556 1537 2494
4004 89 3878 216 3879 136 3702 393 3636 459 3636 330 3761 270 3312 783 3248 845 3122 972 3123 900 3194 645 3384 711 3384 582 3513 514 2556 1539 ...

result:

ok 1

Test #10:

score: 0
Accepted
time: 1ms
memory: 3416kb

input:

55

output:

Yes
22 4008 87 3880 213 3882 148 3683 412 3618 477 3616 351 3744 286 3297 794 3236 859 3108 985 3110 920 3175 648 3382 713 3380 587 3508 522 2545 1550 2480 1615 2352 1741 2354 1676 2163 1924 2106 1989 2104 1863 2232 1798 2297 1282 2748 1347 2620 1473 2622 1408
4009 86 3880 215 3880 149 3690 404 3619...

result:

ok 1

Test #11:

score: 0
Accepted
time: 1ms
memory: 3472kb

input:

89

output:

Yes
58 16193 190 15936 447 15936 317 15554 828 15427 948 15434 693 15688 567 14792 1590 14665 1714 14412 1971 14412 1841 14542 1328 14927 1424 14958 1169 15212 1043 13292 3090 13161 3222 12904 3479 12904 3349 12522 3860 12387 3996 12386 3741 12640 3615 12768 2590 13665 2714 13412 2971 13412 2841 135...

result:

ok 1

Test #12:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

100

output:

Yes
43 16212 169 15958 424 15943 312 15558 825 15428 955 15428 698 15681 574 14784 1599 14656 1725 14402 1980 14403 1844 14538 1333 14920 1463 14920 1206 15177 1074 13260 3123 13132 3249 12878 3504 12879 3344 12526 3857 12396 3987 12396 3730 12649 3606 12776 2583 13672 2709 13418 2964 13411 2844 135...

result:

ok 1

Test #13:

score: 0
Accepted
time: 2ms
memory: 3532kb

input:

200

output:

Yes
86 65193 338 64684 851 64684 593 63918 1616 63631 1904 63630 1393 64140 1139 62348 3186 62089 3446 61576 3959 61576 3701 61834 2676 62595 2940 62594 2429 63104 2175 59264 6270 59009 6522 58500 7035 58500 6777 57734 7800 57479 8040 57494 7529 58004 7275 58260 5226 60049 5486 59536 5999 59536 5741...

result:

ok 1

Test #14:

score: 0
Accepted
time: 2ms
memory: 3532kb

input:

300

output:

Yes
221 261408 735 260384 1758 260385 1242 258852 3291 258340 3801 258342 2776 259367 2248 255798 6345 255284 6859 254260 7882 254257 7374 254768 5327 256304 5837 256306 4812 257331 4292 249658 12485 249144 12999 248120 14022 248121 13506 246588 15555 246076 16065 246078 15040 247103 14400 247742 10...

result:

ok 1

Test #15:

score: 0
Accepted
time: 8ms
memory: 3736kb

input:

400

output:

Yes
172 261459 676 260442 1701 260440 1191 258904 3238 258393 3746 258396 2723 259420 2209 255838 6304 255263 6880 254238 7905 254236 7395 254748 5346 256281 5862 256280 4839 257304 4325 249626 12516 249107 13036 248082 14061 248080 13551 246544 15598 246033 16106 246036 15083 247060 14569 247574 10...

result:

ok 1

Test #16:

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

input:

500

output:

Yes
135 261496 645 260474 1668 260467 1164 258930 3213 258416 3727 258416 2702 259441 2186 255860 6283 255348 6793 254326 7816 254311 7320 254822 5273 256356 5787 256356 4762 257377 4254 249696 12447 249184 12957 248162 13980 248163 13460 246634 15509 246120 16023 246120 14998 247145 14482 247660 10...

result:

ok 1

Test #17:

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

input:

600

output:

Yes
442 1047105 1470 1045056 3519 1045056 2493 1041986 6588 1040963 7604 1040970 5557 1043016 4535 1035848 12726 1034825 13746 1032780 15795 1032780 14769 1033806 10672 1036879 11664 1036910 9617 1038956 8595 1023596 24978 1022569 26006 1020520 28055 1020520 27029 1017450 31124 1016419 32156 1016418...

result:

ok 1

Test #18:

score: 0
Accepted
time: 15ms
memory: 5132kb

input:

700

output:

Yes
497 1047052 1523 1045004 3570 1045001 2550 1041928 6647 1040904 7669 1040906 5620 1042947 4604 1035778 12797 1034752 13823 1032704 15870 1032705 14842 1033732 10747 1036804 11769 1036806 9720 1038855 8680 1023510 25065 1022484 26091 1020436 28138 1020433 27118 1017360 31215 1016336 32237 1016338...

result:

ok 1

Test #19:

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

input:

800

output:

Yes
344 1047207 1352 1045174 3401 1045172 2379 1042100 6474 1041073 7502 1041072 5455 1043120 4429 1035954 12620 1034931 13636 1032890 15685 1032888 14663 1033912 10566 1036985 11586 1036988 9539 1039036 8513 1023678 24896 1022527 26048 1020478 28097 1020476 27075 1017404 31170 1016377 32198 1016376...

result:

ok 1

Test #20:

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

input:

900

output:

Yes
291 1047260 1313 1045214 3360 1045151 2400 1042078 6497 1041052 7523 1041052 5474 1043097 4454 1035928 12647 1034904 13669 1032858 15716 1032851 14700 1033874 10605 1036944 11631 1036944 9582 1038993 8554 1023636 24939 1022612 25961 1020566 28008 1020551 27000 1017478 31097 1016452 32123 1016452...

result:

ok 1

Test #21:

score: 0
Accepted
time: 48ms
memory: 6980kb

input:

1000

output:

Yes
270 1047281 1290 1045236 3339 1045236 2313 1042166 6408 1041127 7448 1041126 5401 1043172 4379 1036004 12570 1034977 13598 1032928 15647 1032928 14621 1033954 10524 1037027 11540 1037034 9493 1039080 8471 1023720 24854 1022697 25874 1020652 27923 1020652 26897 1017582 30992 1016527 32048 1016526...

result:

ok 1

Test #22:

score: 0
Accepted
time: 54ms
memory: 8812kb

input:

1200

output:

Yes
884 4191363 2940 4187266 7037 4187264 4991 4181120 13182 4179073 15226 4179076 11131 4183172 9081 4168838 25464 4166791 27496 4162710 31593 4162708 29547 4164756 21354 4170897 23406 4170896 19311 4174992 17261 4144274 50028 4142227 52068 4138138 56165 4138136 54119 4131992 62310 4129945 64354 41...

result:

ok 1

Test #23:

score: 0
Accepted
time: 81ms
memory: 10628kb

input:

1400

output:

Yes
994 4191257 3046 4187160 7143 4187160 5093 4181018 13284 4178963 15340 4178962 11245 4183056 9199 4168720 25582 4166673 27626 4162580 31723 4162580 29673 4164630 21480 4170759 23544 4170758 19449 4174852 17403 4144132 50170 4142081 52222 4137984 56319 4137984 54269 4131842 62460 4129795 64500 41...

result:

ok 1

Test #24:

score: 0
Accepted
time: 110ms
memory: 13008kb

input:

1600

output:

Yes
688 4191567 2704 4187502 6801 4187500 4755 4181356 12946 4179305 14998 4179304 10903 4183400 8853 4169066 25236 4167011 27292 4162914 31389 4162912 29343 4164960 21150 4171105 23194 4171108 19099 4175204 17049 4144486 49816 4142439 51848 4138358 55945 4138356 53899 4132212 62090 4130161 64142 41...

result:

ok 1

Test #25:

score: 0
Accepted
time: 114ms
memory: 15600kb

input:

1800

output:

Yes
582 4191673 2626 4187580 6723 4187580 4673 4181438 12864 4179263 15040 4179262 10945 4183356 8899 4169020 25282 4166969 27334 4162872 31431 4162872 29381 4164922 21188 4171059 23244 4171058 19149 4175152 17103 4144432 49870 4142385 51914 4138292 56011 4138292 53961 4132150 62152 4130087 64216 41...

result:

ok 1

Test #26:

score: 0
Accepted
time: 168ms
memory: 17192kb

input:

1900

output:

Yes
621 4191632 2671 4187536 6766 4187537 4714 4181396 12907 4179348 14953 4179350 10856 4183431 8824 4169094 25209 4167044 27259 4162948 31354 4162945 29310 4164992 21119 4171136 23165 4171138 19068 4175235 17012 4144522 49781 4142472 51831 4138376 55926 4138377 53874 4132236 62067 4130188 64113 41...

result:

ok 1

Test #27:

score: 0
Accepted
time: 164ms
memory: 17472kb

input:

1920

output:

Yes
544 4191647 2656 4187550 6753 4187548 4707 4181404 12898 4179353 14950 4179352 10855 4183448 8805 4169114 25188 4167059 27244 4162962 31341 4162960 29295 4165008 21102 4171153 23146 4171156 19051 4175252 17001 4144534 49768 4142471 51832 4138374 55929 4138372 53883 4132228 62074 4130177 64126 41...

result:

ok 1

Test #28:

score: 0
Accepted
time: 172ms
memory: 18800kb

input:

2000

output:

Yes
540 4191715 2580 4187626 6677 4187624 4631 4181480 12822 4179433 14866 4179436 10771 4183532 8721 4169198 25104 4167119 27184 4163022 31281 4163020 29235 4165068 21042 4171209 23094 4171208 18999 4175304 16949 4144586 49716 4142531 51772 4138434 55869 4138432 53823 4132288 62014 4130241 64058 41...

result:

ok 1

Test #29:

score: 0
Accepted
time: 1ms
memory: 3452kb

input:

62

output:

Yes
16 4014 81 3884 211 3884 146 3689 406 3624 471 3624 341 3754 276 3299 796 3234 861 3104 991 3104 926 3169 666 3364 731 3364 601 3494 536 2535 1544 2486 1609 2356 1739 2356 1674 2161 1934 2096 1999 2096 1869 2226 1804 2291 1284 2746 1349 2616 1479 2616 1414 2681 1154 2876 1219 2876 1089 3006
3983...

result:

ok 1

Test #30:

score: 0
Accepted
time: 1ms
memory: 3464kb

input:

130

output:

Yes
97 65182 352 64671 800 64734 545 63964 1571 63708 1826 63705 1318 64216 1063 62424 3109 62170 3364 61651 3884 61650 3629 61904 2607 62672 2862 62673 2346 63188 2091 59348 6185 59094 6440 58567 6968 58566 6713 57796 7739 57540 7994 57537 7486 58048 7231 58304 5181 60098 5436 59587 5940 59594 5685...

result:

ok 1

Test #31:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

126

output:

Yes
32 16222 161 15964 419 15964 290 15577 806 15448 935 15448 677 15706 548 14803 1580 14674 1709 14416 1967 14416 1838 14545 1322 14932 1451 14932 1193 15190 1064 13255 3128 13126 3257 12868 3515 12868 3386 12481 3902 12352 4031 12352 3773 12610 3644 12739 2612 13642 2741 13384 2999 13384 2870 135...

result:

ok 1

Test #32:

score: 0
Accepted
time: 1ms
memory: 3400kb

input:

66

output:

Yes
49 16206 176 15951 400 15982 273 15596 787 15468 914 15465 662 15720 535 14824 1557 14698 1684 14435 1948 14434 1821 14560 1311 14944 1438 14945 1178 15204 1051 13284 3097 13158 3224 12903 3464 12918 3337 12532 3851 12404 3978 12401 3726 12656 3599 12784 2573 13682 2700 13427 2948 13434 2821 135...

result:

ok 1

Test #33:

score: 0
Accepted
time: 50ms
memory: 7204kb

input:

1021

output:

Yes
257 1047292 1283 1045244 3330 1045241 2310 1042168 6407 1041144 7429 1041146 5380 1043187 4364 1036018 12557 1034992 13583 1032944 15630 1032945 14602 1033972 10507 1037044 11529 1037046 9480 1039079 8472 1023718 24857 1022692 25883 1020644 27930 1020641 26910 1017568 31007 1016544 32029 1016546...

result:

ok 1

Test #34:

score: 0
Accepted
time: 46ms
memory: 7156kb

input:

1022

output:

Yes
256 1047294 1281 1045244 3331 1045244 2306 1042169 6406 1041144 7431 1041144 5381 1043194 4356 1036019 12556 1034994 13581 1032944 15631 1032944 14606 1033969 10506 1037044 11531 1037044 9481 1039094 8456 1023719 24856 1022694 25881 1020644 27931 1020644 26906 1017569 31006 1016544 32031 1016544...

result:

ok 1

Test #35:

score: 0
Accepted
time: 43ms
memory: 7180kb

input:

1023

output:

Yes
256 1047294 1281 1045244 3331 1045244 2306 1042169 6406 1041144 7431 1041144 5381 1043194 4356 1036019 12556 1034994 13581 1032944 15631 1032944 14606 1033969 10506 1037044 11531 1037044 9481 1039094 8456 1023719 24856 1022694 25881 1020644 27931 1020644 26906 1017569 31006 1016544 32031 1016544...

result:

ok 1

Test #36:

score: 0
Accepted
time: 52ms
memory: 7180kb

input:

1024

output:

Yes
768 1046783 1280 1045246 3329 1045244 2307 1042172 6402 1041145 7430 1041144 5383 1043192 4357 1036026 12548 1034995 13580 1032946 15629 1032944 14607 1033968 10510 1037041 11530 1037044 9483 1039092 8457 1023734 24840 1022695 25880 1020646 27929 1020644 26907 1017572 31002 1016545 32030 1016544...

result:

ok 1

Test #37:

score: 0
Accepted
time: 48ms
memory: 7172kb

input:

1025

output:

Yes
768 4191487 2304 4187902 6401 4187900 4355 4181756 12546 4179705 14598 4179704 10503 4183800 8453 4169466 24836 4167411 26892 4163314 30989 4163312 28943 4165360 20750 4171505 22794 4171508 18699 4175604 16649 4144886 49416 4142823 51480 4138726 55577 4138724 53531 4132580 61722 4130529 63774 41...

result:

ok 1

Test #38:

score: 0
Accepted
time: 47ms
memory: 7244kb

input:

1026

output:

Yes
769 4191486 2816 4187391 6400 4187902 4353 4181756 12547 4179708 14594 4179705 10502 4183800 8455 4169464 24837 4167418 26884 4163315 30988 4163314 28941 4165360 20751 4171504 22798 4171505 18698 4175604 16651 4144884 49417 4142838 51464 4138727 55576 4138726 53529 4132580 61723 4130532 63770 41...

result:

ok 1

Test #39:

score: 0
Accepted
time: 52ms
memory: 7180kb

input:

1027

output:

Yes
769 4191486 2816 4187391 6400 4187902 4353 4181756 12547 4179708 14594 4179705 10502 4183800 8455 4169464 24837 4167418 26884 4163315 30988 4163314 28941 4165360 20751 4171504 22798 4171505 18698 4175604 16651 4144884 49417 4142838 51464 4138727 55576 4138726 53529 4132580 61723 4130532 63770 41...

result:

ok 1

Extra Test:

score: 0
Extra Test Passed