QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#662594 | #9415. Matrix | Scene# | WA | 0ms | 3852kb | C++14 | 661b | 2024-10-21 07:17:12 | 2024-10-21 07:17:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int maxn=55;
int read(){
int ret=0,f=1;char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
while( isdigit(ch)){ret=(ret<<3)+(ret<<1)+(ch&15);ch=getchar();}
return ret*f;
}
int n;
int a[maxn][maxn];
int main(){
n=read();
if(n==1){
printf("No\n");
return 0;
}
for(int i=1;i<=n;++i) a[1][i]=i;
for(int i=2;i<=n;++i) a[i][1]=i+n;
for(int i=2;i<=n;++i){
for(int j=2;j<=n;++j){
a[i][j]=a[1][j];
}
}
a[2][2]=n+1;
printf("Yes\n");
for(int i=1;i<=n;++i){
for(int j=1;j<=n;++j){
printf("%d ",a[i][j]);
}
printf("\n");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3808kb
input:
2
output:
Yes 1 2 4 3
result:
ok Correct. (1 test case)
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3852kb
input:
3
output:
Yes 1 2 3 5 4 3 6 2 3
result:
wrong answer The number of quadruples 2 is invalid. (test case 1)