QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248804#7629. Make SYSU Great Again IIucup-team197#WA 0ms3432kbC++14890b2023-11-11 21:54:142023-11-11 21:54:14

Judging History

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

  • [2023-11-11 21:54:14]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3432kb
  • [2023-11-11 21:54:14]
  • 提交

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=0;
	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: 3432kb

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.