QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#292159#6309. Aqrefstqwq#WA 0ms3796kbC++141007b2023-12-27 19:53:332023-12-27 19:53:34

Judging History

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

  • [2023-12-27 19:53:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3796kb
  • [2023-12-27 19:53:33]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
char st[N];
int main(){
    int T;scanf("%d",&T);
    while(T--){
        int n,m;scanf("%d%d",&n,&m);
        st[m+1]='\0';
        if(n<=3){
            for(int i=1;i<=m;i++){
                if(i%4==0)st[i]='0';
                else st[i]='1';
            }
            for(int i=1;i<=n;i++)printf("%s\n",st+1);
        }
        else if(m<=3){
            for(int i=1;i<=n;i++){
                if(i%4==0){
                    for(int j=1;j<=m;j++)st[j]='0';
                }
                else{
                    for(int j=1;j<=m;j++)st[j]='1';
                }
                printf("%s\n",st+1);
            }
        }
        else{
            for(int i=1;i<=n;i++){
                for(int j=1;j<=m;j++){
                    if((i-1+j)%4==0)st[j]='0';
                    else st[j]='1';
                }
                printf("%s\n",st+1);
            }
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
2 2
3 4
3 8

output:

11
11
1110
1110
1110
11101110
11101110
11101110

result:

wrong answer Integer parameter [name=ans] equals to 11, violates the range [0, 4] (test case 1)