QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#765870 | #7629. Make SYSU Great Again II | rotcar07 | WA | 0ms | 3668kb | C++23 | 597b | 2024-11-20 15:29:01 | 2024-11-20 15:29:03 |
Judging History
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