QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#130141 | #6376. LaLa and Lamp | czycpp | WA | 1ms | 3608kb | C++14 | 619b | 2023-07-23 17:09:54 | 2023-07-23 17:09:55 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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