QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#801855#9874. Matrix Constructionucup-team5657#WA 0ms3904kbC++201.1kb2024-12-07 10:20:012024-12-07 10:20:03

Judging History

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

  • [2024-12-07 10:20:03]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3904kb
  • [2024-12-07 10:20:01]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define _rep(i_,a_,b_) for(int i_ = (a_); i_ <= (b_); ++i_)
#define mid ((L+R) >> 1)
#define multiCase() int testCnt = in(); _rep(curCase,1,testCnt)
#ifdef ONLINE_JUDGE
#define debug(...) 0
#else
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#endif
using ll = long long;
using pii = pair<int,int>;

int in(void) { int x; scanf("%d", &x); return x; } ll inl(void) { ll x; scanf("%lld", &x); return x; }
void out(int x) { printf("%d ", x); } void outln(int x) { printf("%d\n", x); }
void out(ll x) { printf("%lld ", x); } void outln(ll x) { printf("%lld\n", x); }
template<typename T> void chkmax(T &a, const T &b) { a = max(a, b); } 
template<typename T> void chkmin(T &a, const T &b) { a = min(a, b); } 
mt19937 umi;
int main() {
	multiCase() {
		int n = in(), m = in();
		puts("Yes");
		int cnt = 0;
		_rep(i,1,n) {
			if(m & 1 && i % 2 == 0) {
				cnt += m;
				_rep(j,1,m) out(cnt - j + 1); puts("");
			} else {
				_rep(j,1,m) out(++cnt); puts("");
			}
		}

	}
	return 0;
}	

详细

Test #1:

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

input:

2
1 1
2 3

output:

Yes
1 
Yes
1 2 3 
6 5 4 

result:

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