QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#248764#7629. Make SYSU Great Again IIucup-team197#WA 1ms3644kbC++14674b2023-11-11 21:27:592023-11-11 21:27:59

Judging History

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

  • [2023-11-11 21:27:59]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3644kb
  • [2023-11-11 21:27:59]
  • 提交

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));
			}
		}
	}
	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: 100
Accepted
time: 1ms
memory: 3644kb

input:

4

output:

Yes
12 3 8 5 
1 8 5 2 
12 3 8 5 
1 8 5 2 

result:

ok 1

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3640kb

input:

1

output:

Yes
4 

result:

wrong answer Integer 4 violates the range [0, 3]