QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#808470 | #9874. Matrix Construction | WhiteBread | WA | 0ms | 3640kb | C++14 | 605b | 2024-12-10 21:00:40 | 2024-12-10 21:00:42 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int t;int a[1004][1004];
void solve()
{
int p,q,cnt=1;cin>>p>>q;
for(int j=1;j<=2*q;j++)
{
int w=j;
for(int i=1;w>0;i++,w--)
{
if(i<=p&&w<=q)
a[i][w]=cnt++;
}
}
for(int i=1;i<=p;i++,cout<<'\n')
{
for(int j=1;j<=q;j++)
{
cout<<a[i][j]<<' ';
}
}
}
int main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>t;
while(t--)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3640kb
input:
2 1 1 2 3
output:
1 1 2 4 3 5 6
result:
wrong answer Token parameter [name=ok] equals to "1", doesn't correspond to pattern "[yY][eE][sS]" (test case 1)