QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#142190#6376. LaLa and Lampc1120241725WA 1ms3408kbC++14842b2023-08-18 16:51:392023-08-18 16:51:43

Judging History

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

  • [2023-08-18 16:51:43]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3408kb
  • [2023-08-18 16:51:39]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
inline int read(){
    int s=0,w=1;char ch=getchar();
    for(;ch<'0'||ch>'9';ch=getchar())if(ch=='-')w=-w;
    for(;ch>='0'&&ch<='9';ch=getchar())s=s*10+ch-'0';
    return s*w;
}
inline void write(int x){
    if(x<0)x=-x,putchar('-');
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
int n;
int a[2001][2001];
int way[6][2]={{0,0},{0,1},{1,0},{1,2},{2,1},{2,2}};
int main(){
	n=read();
	for(int i=1;i<=n;++i)for(int j=1;j<=i;++j){
		char ch;cin>>ch;a[i][j]=ch-'0';
	}
	for(int i=1;i<=n;++i){
		for(int j=1;j<=i;++j){
			int res=0;
			for(int k=0;k<6;++k){
				int tx=i+way[k][0],ty=j+way[k][1];
				if(tx<1||ty<1||tx>n||ty>i+2){
					res=0;break;
				}
				res^=a[tx][ty];
			}
			if(res){
				puts("No");
				exit(0);
			}
		}
	}
	puts("Yes");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6
0
00
000
0110
00100
000000

output:

No

result:

wrong answer expected YES, found NO