QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#772299#7629. Make SYSU Great Again IICrysflyWA 1ms3688kbC++171.3kb2024-11-22 18:27:242024-11-22 18:27:24

Judging History

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

  • [2024-11-22 18:27:24]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3688kb
  • [2024-11-22 18:27:24]
  • 提交

answer

#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 int long long
using namespace std;

const int maxn = 5555;
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define mkp make_pair

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) {
            a[j][(j+i)%(1<<k)]^=b[i];
            a[j][(j-i+(1<<k))%(1<<k)]^=(b[i]<<k);
        }
    }

    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]+(1<<k))%(1<<k);
                    int y=(j+dy[d]+(1<<k))%(1<<k);
                    w|=a[x][y];
                }
                a[i][j]=w^((1<<k)-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

*/

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3688kb

input:

4

output:

Yes
0 12 15 12
12 0 12 15
15 12 0 12
12 15 12 0

result:

wrong answer The integer 12 appears more than 5 times