QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#203199#6309. Aqre___WA 0ms1632kbC11915b2023-10-06 16:04:562023-10-06 16:04:57

Judging History

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

  • [2023-10-06 16:04:57]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:1632kb
  • [2023-10-06 16:04:56]
  • 提交

answer

#include<stdio.h>
int s[4][4]={
    {1,1,1,0},
    {1,0,1,1},
    {1,1,1,0},
    {0,1,0,0}
};
int a[1000][1000];
int main(){
    int t;scanf("%d",&t);
    while(t--){
        int n,m;
        scanf("%d%d",&n,&m);
        int cnt=0;
        if(n==3&&m<=3){
            printf("%d\n",n*m);
            for(int i=1;i<=n;i++){
                for(int i=1;i<=m;i++)putchar('1');
                putchar('\n');
            }
            continue;
        }
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++){
                if(i==n-1&&j==m-1&&n%4==1&&m%4==1)a[i][j]=0;
                else{
                    a[i][j]=s[i%4][j%4];
                    if(a[i][j])cnt++;
                }
            }
        printf("%d\n",cnt);
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++)putchar(a[i][j]+'0');
            putchar('\n');
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
2 2
3 4
3 8

output:

3
11
10
9
1110
1011
1110
18
11101110
10111011
11101110

result:

wrong answer ans finds a larger answer (test case 1)