QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#765870#7629. Make SYSU Great Again IIrotcar07WA 0ms3668kbC++23597b2024-11-20 15:29:012024-11-20 15:29:03

Judging History

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

  • [2024-11-20 15:29:03]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3668kb
  • [2024-11-20 15:29:01]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=2005;
int f[N][N],h[N];
int main(){
    int n;cin>>n;
    cout<<"Yes\n";
    int l=!n?1:__lg(n-1)+1;
    for(int i=0;i<n;i++){
        for(int j=0;j<l;j++) h[i+1]|=((i>>j&1)^(i>>j+1&1))<<j;
    }
    for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)if(i+j+1&1){
        f[i][j]=h[i+j>>1]<<l|h[abs(i-j)+2>>1];
    }
    int ful=(1<<2*l)-1;
    for(int i=1;i<=n;i++,cout<<'\n')
    for(int j=1;j<=n;j++){
        if(i+j&1) cout<<((f[i][j-1]|f[i-1][j]|f[i+1][j]|f[i][j+1])^ful)<<' ';
        else cout<<f[i][j]<<' ';
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3668kb

input:

4

output:

Yes
0 10 5 2 
10 4 2 13 
5 2 12 2 
2 13 2 8 

result:

wrong answer The integer 2 appears more than 5 times