QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#809452#9874. Matrix Constructionwjh111WA 0ms3640kbC++11457b2024-12-11 15:09:562024-12-11 15:10:04

Judging History

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

  • [2024-12-11 15:10:04]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2024-12-11 15:09:56]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,m,i,t,j;
	cin>>t;
	while (t--){
		int u=1;
		cin>>n>>m;
		for (i=1;i<=n;i++){
			if (i%2){
				cout<<u<<" ";
				for (j=2;j<=m;j++){
					cout<<u+m+1-j<<" ";
				}
				cout<<"\n";
			}
			else{
				for (j=1;j<=m;j++){
					cout<<u+m-j<<" ";
				}
				cout<<"\n";
			}
			u+=m;
		}
	}
} 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
1 1
2 3

output:

1 
1 3 2 
6 5 4 

result:

wrong answer Token parameter [name=ok] equals to "1", doesn't correspond to pattern "[yY][eE][sS]" (test case 1)