QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#807838#9874. Matrix ConstructionHalloWorldWA 0ms3688kbC++201.0kb2024-12-10 12:59:352024-12-10 12:59:36

Judging History

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

  • [2024-12-10 12:59:36]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3688kb
  • [2024-12-10 12:59:35]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define SZ(x) ((int)(x).size())
#define debug(a) cout<<#a<<":"<<a<<endl
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,b,a) for(int i=b;i>=a;i--)
constexpr int N=1010;
constexpr int INF=2e9;
constexpr ll LLF=2e18;
constexpr ll mod=998244353;
constexpr int dir[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
ll powmod(ll a,ll b,ll mod=mod) {ll res=1;a%=mod;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll inv(ll a){return powmod(a,mod-2);}
int n,m;
int ans[N][N];
void solve() {
	cin>>n>>m;
	int now=0;
	rep(i,1,n){
		rep(j,1,m){
			ans[i][j]=++now;
		}
	}
	rep(i,1,n){
		rep(j,1,m){
			if((i&1)&&(m&1)&&(j==1)) continue;
			cout<<ans[i][j]<<" ";
		}
		if((i&1)&&(m&1)) cout<<ans[i][1]<<" ";;
		cout<<"\n";
	}
}
int main() {
	ios::sync_with_stdio(false);cin.tie(nullptr);
	//cout<<fixed<<setprecision(10);
	int testcase;cin>>testcase;rep(_,1,testcase){
		solve();
	}
	return 0;	
}

詳細信息

Test #1:

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

input:

2
1 1
2 3

output:

1 
2 3 1 
4 5 6 

result:

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