QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#248800 | #7629. Make SYSU Great Again II | ucup-team197# | WA | 0ms | 3680kb | C++14 | 890b | 2023-11-11 21:52:02 | 2023-11-11 21:52:03 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
int n;
int ans[2001][2001];
int main(){
ios::sync_with_stdio(false);
cin >> n;
for(int i=1; i<=n ;i++){
for(int j=1; j<=n ;j++){
if((i+j)%2) ans[i][j]=1;
}
}
int mxr=1;
while((1<<(mxr+1))<=n) mxr++;
for(int r=0; r<=mxr ;r++){
int cur=0;
for(int j=1; j<=n ;j++){
if((j&-j)==(1<<r)){
cur^=1;continue;
}
for(int i=1; i<=n ;i++){
if((i+j)%2==cur) ans[i][j]^=(1<<(r+1));
}
}
}
for(int r=0; r<=mxr ;r++){
int cur=0;
for(int j=1; j<=n ;j++){
if((j&-j)==(1<<r)){
cur^=1;continue;
}
for(int i=1; i<=n ;i++){
if((i+j)%2==cur) ans[j][i]^=(1<<(r+1+mxr));
}
}
}
cout << "Yes\n";
for(int i=1; i<=n ;i++){
for(int j=1; j<=n ;j++){
cout << ans[i][j] << ' ';
}
cout << '\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3680kb
input:
4
output:
Yes 60 3 56 5 9 40 13 34 44 19 40 21 17 0 21 10
result:
wrong answer There exist two adjacent numbers whose bitwise AND value is greater than 0.