QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#142190 | #6376. LaLa and Lamp | c1120241725 | WA | 1ms | 3408kb | C++14 | 842b | 2023-08-18 16:51:39 | 2023-08-18 16:51:43 |
Judging History
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