QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#248764 | #7629. Make SYSU Great Again II | ucup-team197# | WA | 1ms | 3644kb | C++14 | 674b | 2023-11-11 21:27:59 | 2023-11-11 21:27:59 |
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));
}
}
}
cout << "Yes\n";
for(int i=1; i<=n ;i++){
for(int j=1; j<=n ;j++){
cout << ans[i][j] << ' ';
}
cout << '\n';
}
}
詳細信息
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]