QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#130141#6376. LaLa and LampczycppWA 1ms3608kbC++14619b2023-07-23 17:09:542023-07-23 17:09:55

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:09:55]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3608kb
  • [2023-07-23 17:09:54]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n;
int mp[2002][2002],x[2002],y[2002];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)for(int j=1;j<=i;j++)scanf(" %c",&mp[i][j]),mp[i][j]-='0';
	for(int i=0;i<2;i++)for(int j=0;j<2;j++){
		for(int k=1;k<=n;k++){
			x[k]=y[k]^mp[n][k]^i;
			y[k+1]=x[k]^mp[n-i][k]^j;
		}
		bool sb=0;
		for(int k=1;k<=n-2;k++){
			int sb2=-1;
			for(int l=1;l<=k;l++){
				if(sb2==-1)sb2=y[n-(k-l)]^x[l]^mp[k][l];
				else if(sb2!=(y[n-(k-l)]^x[l]^mp[k][l])&&(sb=1))break;
			}
			if(sb)break;
		}
		if(sb)return puts("Yes"),0;
	}
	puts("No");
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3608kb

input:

6
0
00
000
0110
00100
000000

output:

Yes

result:

ok answer is YES

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3552kb

input:

2
0
11

output:

No

result:

wrong answer expected YES, found NO