QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#130184#6376. LaLa and LampkkioWA 1ms5812kbC++141.1kb2023-07-23 17:31:502023-07-23 17:31:52

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-23 17:31:52]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5812kb
  • [2023-07-23 17:31:50]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int maxn=2005;
int a[maxn],b[maxn],c[maxn],s[maxn][maxn],n;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=i;j++)
            scanf("%1d",&s[i][j]);
    for(a[n]=0;a[n]<=1;a[n]++)
        for(a[n-1]=0;a[n-1]<=1;a[n-1]++)
            for(b[1]=0;b[1]<=1;b[1]++)
            {
                c[1]=s[n][1]^a[n]^b[1];
                for(int i=2;i<=n;i++)
                    c[i]=s[n-1][i-1]^b[i-1]^a[n-1],b[i]=a[n]^c[i]^s[n][i];
                bool ok=1;
                for(int i=n-3;i>=1;i--)
                {
                    int flag=0;
                    for(int j=1;j<=n;j++)
                    {
                        int v=s[i][j]^c[n-i+j]^b[j];
                        if(v)flag|=2;
                        else flag|=1;
                    }
                    if(flag==3){ok=0;break;}
                }
                if(ok){
                    puts("Yes");
                    return 0;
                }
            }
    puts("No");
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5812kb

input:

6
0
00
000
0110
00100
000000

output:

No

result:

wrong answer expected YES, found NO