QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#108274 | #6376. LaLa and Lamp | zhanghaojie | WA | 2ms | 3736kb | C++14 | 551b | 2023-05-24 10:33:52 | 2023-05-24 10:33:55 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 2010;
char str[N][N];
int n,dx[6]={0,0,1,2,2,1},dy[6]={0,1,2,2,1,0};
int main()
{
cin>>n;
bool ans=1;
for(int i=1;i<=n;i++)
scanf("%s",str[i]+1);
for(int i=1;i<=n;i++)
for(int j=1;j<=i;j++)
{
bool suc=0;
for(int k=0;k<6;k++)
{
int x=i+dx[k],y=j+dy[k];
if(x>n||y>n||y>i)
{
suc=0;
break;
}
if(str[x][y]=='1') suc^=1;
}
if(suc)
{
ans=0;
break;
}
}
if(ans) puts("Yes");
else puts("No");
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3556kb
input:
6 0 00 000 0110 00100 000000
output:
Yes
result:
ok answer is YES
Test #2:
score: 0
Accepted
time: 2ms
memory: 3736kb
input:
2 0 11
output:
Yes
result:
ok answer is YES
Test #3:
score: 0
Accepted
time: 2ms
memory: 3520kb
input:
3 1 10 011
output:
Yes
result:
ok answer is YES
Test #4:
score: -100
Wrong Answer
time: 2ms
memory: 3448kb
input:
4 1 11 101 0101
output:
Yes
result:
wrong answer expected NO, found YES