QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#875906#9874. Matrix Constructionwindcity#WA 0ms3840kbC++14389b2025-01-30 14:10:542025-01-30 14:10:54

Judging History

This is the latest submission verdict.

  • [2025-01-30 14:10:54]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3840kb
  • [2025-01-30 14:10:54]
  • Submitted

answer

#include<cmath>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n,m;
		scanf("%d%d",&n,&m);
		printf("YES\n");
		for(register int i=1;i<=n;++i){
		    for(register int j=1;j<=m;++j)
		        printf("%d ",(i-1)*m+j);
		    printf("\n");
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3840kb

input:

2
1 1
2 3

output:

YES
1 
YES
1 2 3 
4 5 6 

result:

wrong answer Duplicate sum found for adjacent elements at (1,2) and (1,3) (test case 2)