QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#203313#6309. Aqre___Compile Error//C111.3kb2023-10-06 16:45:312023-10-06 16:45:32

Judging History

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

  • [2023-10-06 16:45:32]
  • 评测
  • [2023-10-06 16:45:31]
  • 提交

answer

#include<stdio.h>
int s1[4][4]={
    {1,1,1,0},{0,1,1,1},{1,1,0,1},{1,0,1,1}
};
int s4[4][4]={
    {1,1,1,0},{1,0,1,1},{0,1,1,1},{1,1,0,1}
}
int s3[4][4];
int s2[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);
    for(int i=0;i<4;i++)for(int j=0;j<4;j++)
        s3[i][j]=s1[j][i];
    for(int pwp=1;pwp<=t;pwp++){
        int n,m;
        scanf("%d%d",&n,&m);
     //   printf("PPP%d %d %d\n",pwp,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;
        }
        int (*s)[4];
        if(n<4||m<4)s=s2;
        else if(m%2!=1||n%2==1)s=s1;
        else s=s3;
        if(n%4==1&&m%4==1)s=s4;
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++){
                if(0&&(i==0&&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');
        }
      //  if(pwp==61)while(1);
    }
    return 0;
}

詳細信息

answer.code:8:1: error: expected ‘,’ or ‘;’ before ‘int’
 int s3[4][4];
 ^~~
answer.code: In function ‘main’:
answer.code:21:9: error: ‘s3’ undeclared (first use in this function); did you mean ‘s2’?
         s3[i][j]=s1[j][i];
         ^~
         s2
answer.code:21:9: note: each undeclared identifier is reported only once for each function it appears in
answer.code:19:11: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     int t;scanf("%d",&t);
           ^~~~~~~~~~~~~~
answer.code:24:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&n,&m);
         ^~~~~~~~~~~~~~~~~~~