QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#807838 | #9874. Matrix Construction | HalloWorld | WA | 0ms | 3688kb | C++20 | 1.0kb | 2024-12-10 12:59:35 | 2024-12-10 12:59:36 |
Judging History
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)