QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#673927#5438. Half MixedxcyyyyyWA 0ms3864kbC++20672b2024-10-25 11:50:432024-10-25 11:50:43

Judging History

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

  • [2024-10-25 11:50:43]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3864kb
  • [2024-10-25 11:50:43]
  • 提交

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)