QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#275158 | #7629. Make SYSU Great Again II | ship2077 | AC ✓ | 187ms | 19684kb | C++14 | 869b | 2023-12-04 14:18:36 | 2023-12-04 14:18:37 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int M=2005;
int n,k,lim,a[M][M];
int read(){
int x=0,f=1;char ch=getchar();
while (!isdigit(ch)) {if (ch=='-') f=-1;ch=getchar();}
while (isdigit(ch)) x=x*10+ch-48,ch=getchar();
return x*f;
}
int g(int n){return n^(n>>1);}
int main(){
n=read();k=(int)ceil(log2(n));
lim=(1<<k*2)-1;
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
if (i+j&1)
a[i][j]=g((j-i+n-1)/2)<<k|g((i+j)/2-1);
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
if (~i+j&1)
a[i][j]=lim^(a[i-1][j]|a[i+1][j]|a[i][j-1]|a[i][j+1]);
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
assert((a[i][j]&a[i][j+1])==0),
assert((a[i][j]&a[i+1][j])==0),
assert(a[i][j]<n*n*4);
puts("Yes");
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++)
printf("%d ",a[i][j]);
puts("");
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3992kb
input:
4
output:
Yes 3 12 2 9 4 2 13 0 10 5 0 15 1 8 7 0
result:
ok 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
1
output:
Yes 0
result:
ok 1
Test #3:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
2
output:
Yes 1 2 0 1
result:
ok 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3980kb
input:
3
output:
Yes 11 4 10 0 10 5 14 1 10
result:
ok 1
Test #5:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
5
output:
Yes 39 24 38 17 44 8 38 25 36 19 54 9 36 27 36 1 52 11 36 26 60 3 52 10 37
result:
ok 1
Test #6:
score: 0
Accepted
time: 0ms
memory: 3992kb
input:
8
output:
Yes 15 48 6 57 4 43 20 34 16 14 49 4 59 4 42 17 38 17 12 51 4 58 1 46 25 36 19 12 50 1 62 0 36 27 36 18 9 54 0 63 11 36 26 33 22 8 55 0 52 10 33 30 32 23 8 53 2 49 14 32 31 32 21 10
result:
ok 1
Test #7:
score: 0
Accepted
time: 0ms
memory: 3944kb
input:
13
output:
Yes 143 80 174 65 60 195 44 210 9 246 8 231 24 112 142 81 172 67 60 194 41 214 8 247 8 229 142 113 140 83 172 66 57 198 40 215 8 245 10 97 140 115 140 82 169 70 56 199 40 213 10 244 156 99 140 114 137 86 168 71 56 197 42 212 3 35 156 98 137 118 136 87 168 69 58 196 35 220 204 34 153 102 136 11...
result:
ok 1
Test #8:
score: 0
Accepted
time: 0ms
memory: 4056kb
input:
21
output:
Yes 543 480 542 449 572 323 668 354 665 294 728 263 248 773 218 804 147 876 146 845 176 416 542 481 540 451 572 322 665 358 664 295 728 261 250 772 211 812 146 877 144 847 606 417 540 483 540 450 569 326 664 359 664 293 730 260 243 780 210 813 144 879 144 385 604 419 540 482 537 454 568 327 664 3...
result:
ok 1
Test #9:
score: 0
Accepted
time: 0ms
memory: 4096kb
input:
34
output:
Yes 2495 1600 2366 1729 2364 1667 2172 1922 2105 1990 2104 1863 2232 1797 2298 1284 2739 1356 2610 1485 2608 1423 2672 1166 2865 1226 2868 1099 2996 1033 1014 3080 935 3160 1536 2494 1601 2364 1731 2364 1666 2169 1926 2104 1991 2104 1861 2234 1796 2291 1292 2738 1357 2608 1487 2608 1422 2673 1162 2...
result:
ok 1
Test #10:
score: 0
Accepted
time: 1ms
memory: 4060kb
input:
55
output:
Yes 2623 1408 2686 1153 2876 1219 2876 1090 3001 1030 1016 3079 952 3141 826 3268 819 3212 626 3469 560 3535 560 3406 689 3338 244 3851 180 3913 54 4040 39 3992 102 3737 292 3803 292 3674 417 3614 480 2591 1440 2653 1314 2780 1315 2708 1130 2965 1064 3031 1064 1472 2622 1409 2684 1155 2876 1218 287...
result:
ok 1
Test #11:
score: 0
Accepted
time: 1ms
memory: 6196kb
input:
89
output:
Yes 8447 7424 8830 7553 8828 7299 9084 7170 9209 5126 11128 5255 10872 5509 10874 5380 10483 5900 10354 6029 10352 5775 10608 5646 10737 4618 11636 4747 11380 5001 11382 4872 11495 4376 11878 4505 11876 4251 12132 4122 4065 12318 3936 12447 3680 12701 3682 12572 3299 13076 3178 13205 3176 12951 3432...
result:
ok 1
Test #12:
score: 0
Accepted
time: 1ms
memory: 4400kb
input:
100
output:
Yes 10879 5504 10878 5377 10492 5891 10364 6018 10361 5766 10616 5639 10744 4613 11642 4740 11379 5004 11378 4877 11504 4367 11888 4494 11889 4234 12148 4107 4084 12297 3958 12424 3687 12696 3686 12569 3300 13083 3172 13210 3169 12958 3424 12831 2528 13853 2402 13980 2147 14228 2154 14101 2280 13591...
result:
ok 1
Test #13:
score: 0
Accepted
time: 3ms
memory: 6296kb
input:
200
output:
Yes 43519 22016 43262 22273 43260 21763 43772 21506 41977 23558 41720 23815 41208 24325 41210 24068 41459 23052 42226 23309 42224 22799 42736 22542 42993 18442 46836 18699 46324 19209 46326 18952 45543 19992 45286 20249 45284 19739 45796 19482 46049 17438 47840 17695 47328 18205 47330 17948 47587 16...
result:
ok 1
Test #14:
score: 0
Accepted
time: 2ms
memory: 6516kb
input:
300
output:
Yes 147967 113152 148990 112641 149500 108547 153084 109058 152057 110086 152056 109575 152568 107525 154106 108036 154099 107020 155122 106509 139248 122895 138736 123406 137713 124426 137716 123915 136180 125961 135670 126472 135655 125464 136678 124953 133092 129051 132580 129562 131553 130590 13...
result:
ok 1
Test #15:
score: 0
Accepted
time: 6ms
memory: 6708kb
input:
400
output:
Yes 174079 88064 173566 88577 172540 89603 172540 89090 173049 87046 174584 87559 174584 86533 175610 86020 167923 94220 167410 94733 166384 95759 166384 95246 164849 97290 164340 97803 164340 96777 165366 96264 165863 92184 169446 92697 168420 93723 168420 93210 168929 91166 170464 91679 170464 906...
result:
ok 1
Test #16:
score: 0
Accepted
time: 9ms
memory: 8992kb
input:
500
output:
Yes 193023 69120 193022 68609 193532 66563 195068 67074 195065 66054 196088 65543 65528 196613 65018 197124 63987 198156 63986 197645 62448 199695 61936 200206 61937 199178 62964 198667 59380 202761 58870 203272 57831 204312 57830 203801 58340 201755 59876 202266 59873 201246 60896 200735 53216 2089...
result:
ok 1
Test #17:
score: 0
Accepted
time: 15ms
memory: 10192kb
input:
600
output:
Yes 591871 452608 594942 453633 594940 451587 596988 450562 598009 434182 613368 435207 611320 437253 611322 436228 608243 440332 607218 441357 607216 439311 609264 438286 610289 430090 617460 431115 615412 433161 615414 432136 616423 428056 619494 429081 619492 427035 621540 426010 557025 491550 55...
result:
ok 1
Test #18:
score: 0
Accepted
time: 18ms
memory: 11000kb
input:
700
output:
Yes 537599 508928 539646 507905 540668 475139 572412 476162 570361 478214 570360 477191 567288 481285 566266 482308 566259 480268 568306 479245 561136 487439 560112 488462 558065 490506 558068 489483 559092 485385 562166 486408 562151 484376 564198 483353 565220 466971 580580 467994 578529 470046 57...
result:
ok 1
Test #19:
score: 0
Accepted
time: 34ms
memory: 12184kb
input:
800
output:
Yes 696319 352256 695294 353281 693244 355331 693244 354306 690169 358406 689144 359431 689144 357381 691194 356356 692211 348172 699378 349197 697328 351247 697328 350222 698353 346122 701428 347147 701428 345097 703478 344072 671719 376856 670694 377881 668644 379931 668644 378906 665569 383006 66...
result:
ok 1
Test #20:
score: 0
Accepted
time: 41ms
memory: 11896kb
input:
900
output:
Yes 750591 297984 750590 296961 747516 301059 746492 302082 746489 300038 748536 299015 741368 307205 740346 308228 738291 310284 738290 309261 739312 305167 742384 306190 742385 304138 744436 303115 729076 319497 728054 320520 725991 322584 725990 321561 722916 325659 721892 326682 721889 324638 72...
result:
ok 1
Test #21:
score: 0
Accepted
time: 46ms
memory: 13124kb
input:
1000
output:
Yes 772095 276480 771070 277505 771068 275459 773116 274434 774137 266246 781304 267271 779256 269317 779258 268292 780275 264204 783346 265229 783344 263183 785392 262158 262129 786442 261108 787467 259060 789513 259062 788488 255975 792600 254950 793625 254948 791579 256996 790554 249825 798750 24...
result:
ok 1
Test #22:
score: 0
Accepted
time: 71ms
memory: 13604kb
input:
1200
output:
Yes 2367487 1810432 2381822 1812481 2377724 1816579 2377724 1814530 2379769 1806342 2385912 1808391 2385912 1804293 2390010 1802244 2392051 1736716 2455538 1738765 2451440 1742863 2451440 1740814 2445297 1749002 2443252 1751051 2443252 1746953 2447350 1744904 2432999 1761304 2430950 1763353 2426852 ...
result:
ok 1
Test #23:
score: 0
Accepted
time: 85ms
memory: 15644kb
input:
1400
output:
Yes 2150399 2035712 2156542 2037761 2156540 2033667 2160636 2031618 2162681 1900550 2291704 1902599 2287608 1906693 2287610 1904644 2281459 1912844 2279410 1914893 2279408 1910799 2283504 1908750 2269169 1925130 2267124 1927179 2263028 1931273 2263030 1929224 2265063 1921048 2271206 1923097 2271204 ...
result:
ok 1
Test #24:
score: 0
Accepted
time: 118ms
memory: 18376kb
input:
1600
output:
Yes 2785279 1409024 2783230 1411073 2779132 1415171 2779132 1413122 2772985 1421318 2770936 1423367 2770936 1419269 2775034 1417220 2760691 1433612 2758642 1435661 2754544 1439759 2754544 1437710 2756593 1429514 2762740 1431563 2762740 1427465 2766838 1425416 2768871 1392664 2799590 1394713 2795492 ...
result:
ok 1
Test #25:
score: 0
Accepted
time: 144ms
memory: 19248kb
input:
1800
output:
Yes 3002367 1191936 3000318 1193985 3000316 1189891 3004412 1187842 2990073 1204230 2988024 1206279 2983928 1210373 2983930 1208324 2985971 1200140 2992114 1202189 2992112 1198095 2996208 1196046 2965489 1228810 2963444 1230859 2959348 1234953 2959350 1232904 2953191 1241112 2951142 1243161 2951140 ...
result:
ok 1
Test #26:
score: 0
Accepted
time: 168ms
memory: 19596kb
input:
1900
output:
Yes 2918399 1271808 2922494 1269761 2924540 1253379 2938876 1255426 2934777 1259526 2934776 1257479 2936824 1249285 2942970 1251332 2942963 1247244 2947058 1245197 2949104 1114127 3078128 1116174 3074033 1120266 3074036 1118219 3067892 1126409 3065846 1128456 3065831 1124376 3069926 1122329 3055588 ...
result:
ok 1
Test #27:
score: 0
Accepted
time: 164ms
memory: 19044kb
input:
1920
output:
Yes 2949119 1114112 3078142 1116161 3074044 1120259 3074044 1118210 3067897 1126406 3065848 1128455 3065848 1124357 3069946 1122308 3055603 1138700 3053554 1140749 3049456 1144847 3049456 1142798 3051505 1134602 3057652 1136651 3057652 1132553 3061750 1130504 3031015 1163288 3028966 1165337 3024868 ...
result:
ok 1
Test #28:
score: 0
Accepted
time: 187ms
memory: 19684kb
input:
2000
output:
Yes 3088383 1105920 3086334 1107969 3082236 1112067 3082236 1110018 3084281 1101830 3090424 1103879 3090424 1099781 3094522 1097732 3096563 1064972 3127282 1067021 3123184 1071119 3123184 1069070 3117041 1077258 3114996 1079307 3114996 1075209 3119094 1073160 3121127 1056792 3135462 1058841 3131364 ...
result:
ok 1
Test #29:
score: 0
Accepted
time: 1ms
memory: 5952kb
input:
62
output:
Yes 3007 1024 1022 3073 956 3139 828 3266 825 3206 632 3463 568 3525 570 3396 691 3340 242 3853 176 3919 48 4046 49 3978 116 3723 308 3785 310 3656 423 3608 486 2585 1444 2651 1316 2778 1313 2718 1120 2975 1056 3037 1058 2908 1187 2836 1258 2325 1704 2391 1576 2518 1577 2450 1644 2195 1836 2257 108...
result:
ok 1
Test #30:
score: 0
Accepted
time: 1ms
memory: 4464kb
input:
130
output:
Yes 40703 24832 40190 25345 40188 25091 39420 26114 39161 26374 39160 25863 39672 25605 37882 27652 37619 27916 37106 28429 37104 28175 37360 27150 38129 27402 38132 26891 38644 26633 34806 30728 34535 31000 34022 31513 34020 31259 33252 32282 32993 32542 32992 32031 33504 31773 33762 29724 35555 29...
result:
ok 1
Test #31:
score: 0
Accepted
time: 1ms
memory: 4588kb
input:
126
output:
Yes 12159 4096 4094 12289 3964 12419 3708 12674 3705 12550 3320 13063 3192 13189 3194 12932 3443 12812 2546 13837 2416 13967 2160 14222 2161 14090 2292 13579 2676 13705 2678 13448 2919 13336 998 15385 868 15515 612 15770 609 15646 224 16159 96 16285 98 16028 355 15892 490 14869 1384 14999 1128 15254...
result:
ok 1
Test #32:
score: 0
Accepted
time: 1ms
memory: 4128kb
input:
66
output:
Yes 10111 6272 9854 6529 9852 6403 9468 6914 9337 7046 9336 6791 9592 6661 8698 7684 8563 7820 8306 8077 8304 7951 8432 7438 8817 7562 8820 7307 9076 7177 9206 5128 11111 5272 10854 5529 10852 5403 10468 5914 10337 6046 10336 5791 10592 5661 10722 4636 11619 4756 11370 5013 11368 4887 11496 4374 118...
result:
ok 1
Test #33:
score: 0
Accepted
time: 48ms
memory: 13388kb
input:
1021
output:
Yes 783359 263168 785406 262145 262140 786435 261116 787458 259065 789510 259064 788487 255992 792581 254970 793604 254963 791564 257010 790541 249840 798735 248816 799758 246769 801802 246772 800779 247796 796681 250870 797704 250855 795672 252902 794649 237540 811035 236516 812058 234465 814110 23...
result:
ok 1
Test #34:
score: 0
Accepted
time: 36ms
memory: 12868kb
input:
1022
output:
Yes 785407 262144 262142 786433 261116 787459 259068 789506 259065 788486 255992 792583 254968 793605 254970 791556 257011 790540 249842 798733 248816 799759 246768 801806 246769 800778 247796 796683 250868 797705 250870 795656 252903 794648 237542 811033 236516 812059 234468 814106 234465 813086 23...
result:
ok 1
Test #35:
score: 0
Accepted
time: 48ms
memory: 13016kb
input:
1023
output:
Yes 785407 262144 262142 786433 261116 787459 259068 789506 259065 788486 255992 792583 254968 793605 254970 791556 257011 790540 249842 798733 248816 799759 246768 801806 246769 800778 247796 796683 250868 797705 250870 795656 252903 794648 237542 811033 236516 812059 234468 814106 234465 813086 23...
result:
ok 1
Test #36:
score: 0
Accepted
time: 40ms
memory: 13432kb
input:
1024
output:
Yes 262143 786432 261118 787457 259068 789507 259068 788482 255993 792582 254968 793607 254968 791557 257018 790532 249843 798732 248818 799757 246768 801807 246768 800782 247793 796682 250868 797707 250868 795657 252918 794632 237543 811032 236518 812057 234468 814107 234468 813082 231393 817182 23...
result:
ok 1
Test #37:
score: 0
Accepted
time: 53ms
memory: 12208kb
input:
1025
output:
Yes 2621439 1572864 2619390 1574913 2615292 1579011 2615292 1576962 2609145 1585158 2607096 1587207 2607096 1583109 2611194 1581060 2596851 1597452 2594802 1599501 2590704 1603599 2590704 1601550 2592753 1593354 2598900 1595403 2598900 1591305 2602998 1589256 2572263 1622040 2570214 1624089 2566116 ...
result:
ok 1
Test #38:
score: 0
Accepted
time: 41ms
memory: 11892kb
input:
1026
output:
Yes 2619391 1574912 2615294 1579009 2615292 1576963 2609148 1585154 2607097 1587206 2607096 1583111 2611192 1581061 2596858 1597444 2594803 1599500 2590706 1603597 2590704 1601551 2592752 1593358 2598897 1595402 2598900 1591307 2602996 1589257 2572278 1622024 2570215 1624088 2566118 1628185 2566116 ...
result:
ok 1
Test #39:
score: 0
Accepted
time: 46ms
memory: 13900kb
input:
1027
output:
Yes 2619391 1574912 2615294 1579009 2615292 1576963 2609148 1585154 2607097 1587206 2607096 1583111 2611192 1581061 2596858 1597444 2594803 1599500 2590706 1603597 2590704 1601551 2592752 1593358 2598897 1595402 2598900 1591307 2602996 1589257 2572278 1622024 2570215 1624088 2566118 1628185 2566116 ...
result:
ok 1
Extra Test:
score: 0
Extra Test Passed