QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#809673#9874. Matrix Constructionwjh111WA 0ms3632kbC++11507b2024-12-11 16:41:072024-12-11 16:41:17

Judging History

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

  • [2024-12-11 16:41:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3632kb
  • [2024-12-11 16:41:07]
  • 提交

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,u;
	cin>>t;
	while (t--){
		u=1;
		cin>>n>>m;
		if (m%2==0){
			for (i=0;i<n;i++){
				for (j=0;j<m;j++){
					cout<<u+j<<" ";
				}
				u+=m;
				cout<<"\n";
			}
		}
		else{
			for (i=0;i<n;i++){
				cout<<u<<" ";
				for (j=1;j<=m/2;j++){
					cout<<u+j*2<<" "<<u+j*2-1<<" ";
				}
				u+=m;
				cout<<"\n";
			}
		}
	}
} 

詳細信息

Test #1:

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

input:

2
1 1
2 3

output:

1 
1 3 2 
4 6 5 

result:

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