QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#772617#7629. Make SYSU Great Again IICrysflyAC ✓168ms86176kbC++141.8kb2024-11-22 20:46:372024-11-22 20:46:45

Judging History

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

  • [2024-11-22 20:46:45]
  • 评测
  • 测评结果:AC
  • 用时:168ms
  • 内存:86176kb
  • [2024-11-22 20:46:37]
  • 提交

answer

// what is matter? never mind. 
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2")
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define ll __int128
//#define ull unsigned long long
#define int long long
#define SZ(x) ((int)((x).size()))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
inline int read()
{
	char c=getchar();int x=0;bool f=0;
	for(;!isdigit(c);c=getchar())f^=!(c^45);
	for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
	return f?-x:x;
}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<ll,ll>pii;
typedef vector<int>vi;

#define maxn 5005
#define inf 0x3f3f3f3f

int n,k;
int b[maxn];
bool vis[maxn];
int a[maxn][maxn];

int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0}; 

signed main(){
    cin>>n;
    while((1<<k)<n)k++;

    For(i,0,(1<<k)-1){
        b[i]=(i^(i>>1));
        if(vis[b[i]]) puts("qaq"),exit(0);
        vis[b[i]]=1;
    }
    
    For(i,0,(1<<k)-1){
        For(j,0,(1<<k)-1) if((i+j)%2==0) {
            int u=(i+j)/2;
            int v=(i-j)/2+(1<<k)/2;
            a[i][j]=(b[u]<<k)|b[v];
        }
    }

    For(i,0,(1<<k)-1)
        For(j,0,(1<<k)-1)
            if((i+j)&1){
                int w=0;
                For(d,0,3){
                    int x=i+dx[d];
                    int y=j+dy[d];
                    if(x>=0 && y>=0 && x<(1<<k) && y<(1<<k)) w|=a[x][y];
                }
                a[i][j]=w^((1<<(k*2))-1);
            }
    
    cout<<"Yes\n";
    For(i,0,n-1) For(j,0,n-1) cout<<a[i][j]<<" \n"[j==n-1];
    return 0;
}
/*
4
0000
0111
1100
1011
0110
0001
1010
1101
0011
0100
1111
1000
0101
0010
1001
1110

*/

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

詳細信息

Test #1:

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

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: 0ms
memory: 3588kb

input:

1

output:

Yes
0

result:

ok 1

Test #3:

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

input:

2

output:

Yes
1 0
0 3

result:

ok 1

Test #4:

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

input:

3

output:

Yes
3 8 5
8 7 0
6 0 15

result:

ok 1

Test #5:

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

input:

5

output:

Yes
6 49 10 36 27
48 14 33 26 36
15 32 30 33 18
32 31 32 22 9
29 32 23 8 54

result:

ok 1

Test #6:

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

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: 3704kb

input:

13

output:

Yes
12 227 20 202 53 200 39 152 102 137 114 140 83
226 28 195 52 202 37 152 103 136 118 137 82 172
29 194 60 195 36 154 101 136 119 136 86 169 66
192 61 194 44 147 100 138 117 136 87 168 70 57
63 192 45 146 108 131 116 138 85 168 71 56 198
192 47 144 109 130 124 131 84 170 69 56 199 40
46 144 111 12...

result:

ok 1

Test #8:

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

input:

21

output:

Yes
24 967 40 918 105 916 75 820 202 785 238 784 175 848 141 626 396 595 420 538 485
966 56 903 104 918 73 820 203 788 234 785 174 848 143 624 397 594 428 531 484 538
57 902 120 903 72 822 201 788 235 788 170 849 142 624 399 592 429 530 492 531 452
900 121 902 88 807 200 790 233 788 171 852 138 625 ...

result:

ok 1

Test #9:

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

input:

34

output:

Yes
48 3983 80 3886 209 3884 147 3692 402 3625 470 3624 343 3752 277 3306 788 3235 860 3106 989 3104 927 3168 670 3361 730 3364 603 3492 537 2534 1560 2471
3982 112 3855 208 3886 145 3692 403 3628 466 3625 342 3752 279 3304 789 3242 852 3107 988 3106 925 3168 671 3360 734 3361 602 3492 539 2532 1561...

result:

ok 1

Test #10:

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

input:

55

output:

Yes
48 3983 80 3886 209 3884 147 3692 402 3625 470 3624 343 3752 277 3306 788 3235 860 3106 989 3104 927 3168 670 3361 730 3364 603 3492 537 2534 1560 2471 1608 2358 1737 2356 1675 2164 1930 2097 1998 2096 1871 2224 1805 2290 1292 2739 1348 2618 1477 2616 1415
3982 112 3855 208 3886 145 3692 403 362...

result:

ok 1

Test #11:

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

input:

89

output:

Yes
96 16159 160 15966 417 15964 291 15580 802 15449 934 15448 679 15704 549 14810 1572 14675 1708 14418 1965 14416 1839 14544 1326 14929 1450 14932 1195 15188 1065 13270 3112 13127 3256 12870 3513 12868 3387 12484 3898 12353 4030 12352 3775 12608 3645 12738 2620 13635 2740 13386 2997 13384 2871 135...

result:

ok 1

Test #12:

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

input:

100

output:

Yes
96 16159 160 15966 417 15964 291 15580 802 15449 934 15448 679 15704 549 14810 1572 14675 1708 14418 1965 14416 1839 14544 1326 14929 1450 14932 1195 15188 1065 13270 3112 13127 3256 12870 3513 12868 3387 12484 3898 12353 4030 12352 3775 12608 3645 12738 2620 13635 2740 13386 2997 13384 2871 135...

result:

ok 1

Test #13:

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

input:

200

output:

Yes
192 65087 320 64702 833 64700 579 63932 1602 63673 1862 63672 1351 64184 1093 62394 3140 62131 3404 61618 3917 61616 3663 61872 2638 62641 2890 62644 2379 63156 2121 59318 6216 59047 6488 58534 7001 58532 6747 57764 7770 57505 8030 57504 7519 58016 7261 58274 5212 60067 5460 59562 5973 59560 571...

result:

ok 1

Test #14:

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

input:

300

output:

Yes
384 261247 640 260478 1665 260476 1155 258940 3202 258425 3718 258424 2695 259448 2181 255866 6276 255347 6796 254322 7821 254320 7311 254832 5262 256369 5770 256372 4747 257396 4233 249718 12424 249191 12952 248166 13977 248164 13467 246628 15514 246113 16030 246112 15007 247136 14493 247650 10...

result:

ok 1

Test #15:

score: 0
Accepted
time: 7ms
memory: 22420kb

input:

400

output:

Yes
384 261247 640 260478 1665 260476 1155 258940 3202 258425 3718 258424 2695 259448 2181 255866 6276 255347 6796 254322 7821 254320 7311 254832 5262 256369 5770 256372 4747 257396 4233 249718 12424 249191 12952 248166 13977 248164 13467 246628 15514 246113 16030 246112 15007 247136 14493 247650 10...

result:

ok 1

Test #16:

score: 0
Accepted
time: 12ms
memory: 24344kb

input:

500

output:

Yes
384 261247 640 260478 1665 260476 1155 258940 3202 258425 3718 258424 2695 259448 2181 255866 6276 255347 6796 254322 7821 254320 7311 254832 5262 256369 5770 256372 4747 257396 4233 249718 12424 249191 12952 248166 13977 248164 13467 246628 15514 246113 16030 246112 15007 247136 14493 247650 10...

result:

ok 1

Test #17:

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

input:

600

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 #18:

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

input:

700

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 #19:

score: 0
Accepted
time: 26ms
memory: 44764kb

input:

800

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 #20:

score: 0
Accepted
time: 33ms
memory: 43104kb

input:

900

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 #21:

score: 0
Accepted
time: 41ms
memory: 44720kb

input:

1000

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 #22:

score: 0
Accepted
time: 76ms
memory: 86176kb

input:

1200

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #23:

score: 0
Accepted
time: 91ms
memory: 83672kb

input:

1400

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #24:

score: 0
Accepted
time: 119ms
memory: 84560kb

input:

1600

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #25:

score: 0
Accepted
time: 137ms
memory: 84048kb

input:

1800

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #26:

score: 0
Accepted
time: 158ms
memory: 84424kb

input:

1900

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #27:

score: 0
Accepted
time: 160ms
memory: 84296kb

input:

1920

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #28:

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

input:

2000

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #29:

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

input:

62

output:

Yes
48 3983 80 3886 209 3884 147 3692 402 3625 470 3624 343 3752 277 3306 788 3235 860 3106 989 3104 927 3168 670 3361 730 3364 603 3492 537 2534 1560 2471 1608 2358 1737 2356 1675 2164 1930 2097 1998 2096 1871 2224 1805 2290 1292 2739 1348 2618 1477 2616 1415 2680 1158 2873 1218 2876 1091 3004
3982...

result:

ok 1

Test #30:

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

input:

130

output:

Yes
192 65087 320 64702 833 64700 579 63932 1602 63673 1862 63672 1351 64184 1093 62394 3140 62131 3404 61618 3917 61616 3663 61872 2638 62641 2890 62644 2379 63156 2121 59318 6216 59047 6488 58534 7001 58532 6747 57764 7770 57505 8030 57504 7519 58016 7261 58274 5212 60067 5460 59562 5973 59560 571...

result:

ok 1

Test #31:

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

input:

126

output:

Yes
96 16159 160 15966 417 15964 291 15580 802 15449 934 15448 679 15704 549 14810 1572 14675 1708 14418 1965 14416 1839 14544 1326 14929 1450 14932 1195 15188 1065 13270 3112 13127 3256 12870 3513 12868 3387 12484 3898 12353 4030 12352 3775 12608 3645 12738 2620 13635 2740 13386 2997 13384 2871 135...

result:

ok 1

Test #32:

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

input:

66

output:

Yes
96 16159 160 15966 417 15964 291 15580 802 15449 934 15448 679 15704 549 14810 1572 14675 1708 14418 1965 14416 1839 14544 1326 14929 1450 14932 1195 15188 1065 13270 3112 13127 3256 12870 3513 12868 3387 12484 3898 12353 4030 12352 3775 12608 3645 12738 2620 13635 2740 13386 2997 13384 2871 135...

result:

ok 1

Test #33:

score: 0
Accepted
time: 39ms
memory: 42916kb

input:

1021

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 #34:

score: 0
Accepted
time: 44ms
memory: 43168kb

input:

1022

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 #35:

score: 0
Accepted
time: 39ms
memory: 44724kb

input:

1023

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 #36:

score: 0
Accepted
time: 39ms
memory: 44772kb

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: 52ms
memory: 84196kb

input:

1025

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #38:

score: 0
Accepted
time: 53ms
memory: 84424kb

input:

1026

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Test #39:

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

input:

1027

output:

Yes
1536 4190719 2560 4187646 6657 4187644 4611 4181500 12802 4179449 14854 4179448 10759 4183544 8709 4169210 25092 4167155 27148 4163058 31245 4163056 29199 4165104 21006 4171249 23050 4171252 18955 4175348 16905 4144630 49672 4142567 51736 4138470 55833 4138468 53787 4132324 61978 4130273 64030 4...

result:

ok 1

Extra Test:

score: 0
Extra Test Passed