QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#883793#9874. Matrix Constructiongaliyuu#WA 0ms3840kbC++23775b2025-02-05 18:55:332025-02-05 18:55:33

Judging History

This is the latest submission verdict.

  • [2025-02-05 18:55:33]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3840kb
  • [2025-02-05 18:55:33]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;++i)
#define per(i,a,n) for(int i=n-1;i>=a;--i)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define endl '\n'
#define SZ(x) ((ll)(x).size())
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef pair<int,int> pii;
typedef double db;
mt19937 mrand(random_device{}());
int rnd(int x){return mrand()%x;}
const ll mod=998244353;

signed main() {
	int tc;
	scanf("%d",&tc);
	while (tc--) {
		int n,m;
		scanf("%d%d",&n,&m);
		int id=1;
		puts("Yes");
		rep(i,0,n) rep(j,0,m) {
			printf("%d ",id);
			id++;
			if (j==m-1) puts("");
		}
	}
}

详细

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)