QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#662594#9415. MatrixScene#WA 0ms3852kbC++14661b2024-10-21 07:17:122024-10-21 07:17:12

Judging History

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

  • [2024-10-21 07:17:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3852kb
  • [2024-10-21 07:17:12]
  • 提交

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)