QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#624623 | #9415. Matrix | dztlb | WA | 0ms | 3664kb | C++14 | 692b | 2024-10-09 16:16:33 | 2024-10-09 16:16:39 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N=1005;
int n;
int a[55][55];
signed main(){
cin>>n;
puts("Yes");
a[1][1]=1,a[1][2]=2;
a[2][1]=3,a[2][2]=4;
for(int i=3;i<=50;++i){
a[1][i]=5;
a[2][i]=5;
a[i][1]=5;
a[i][2]=5;
}
int now=6;
for(int i=3;i<=50;i+=2){
a[i][i]=now;
a[i+1][i]=now+1;
a[i][i+1]=now+1;
a[i+1][i+1]=now+2;
for(int j=i+2;j<=50;++j){
a[i][j]=now+3;
a[i+1][j]=now+3;
a[j][i]=now+3;
a[j][i+1]=now+3;
}
now+=2;
}
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
cout<<a[i][j]<<' ';
} cout<<endl;
}
return 0;
}
/*
3 4
X.X.
...X
...X
....
....
....
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3664kb
input:
2
output:
Yes 1 2 3 4
result:
ok Correct. (1 test case)
Test #2:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
3
output:
Yes 1 2 5 3 4 5 5 5 6
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
4
output:
Yes 1 2 5 5 3 4 5 5 5 5 6 7 5 5 7 8
result:
ok Correct. (1 test case)
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3592kb
input:
5
output:
Yes 1 2 5 5 5 3 4 5 5 5 5 5 6 7 9 5 5 7 8 9 5 5 9 9 8
result:
wrong answer Integer 10 didn't appear. (test case 1)