QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#673927 | #5438. Half Mixed | xcyyyyy | WA | 0ms | 3864kb | C++20 | 672b | 2024-10-25 11:50:43 | 2024-10-25 11:50:43 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define N 5005
#define M 10005
#define p 998244353
#define ll long long
void work(){
int n,m;
scanf("%d%d",&n,&m);
if((n&1)&&(m&1))return puts("No"),void();
puts("Yes");
if(~n&1){
for(int i=1;i<=n/2;i++,puts(""))
for(int j=1;j<=m;j++)printf("1 ");
for(int i=1;i<=n/2;i++,puts(""))
for(int j=1;j<=m;j++)printf("0 ");
}
else{
for(int i=1;i<=n;i++){
for(int j=1;j<=m/2;j++)printf("1 ");
for(int j=1;j<=m/2;j++)printf("0 ");
}
}
}
int main(){
int t;scanf("%d",&t);while(t--)
work();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3864kb
input:
2 2 3 1 1
output:
Yes 1 1 1 0 0 0 No
result:
wrong answer 6 Mixed Submatrices Found, but 9 Expected (test case 1)