QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#108274#6376. LaLa and LampzhanghaojieWA 2ms3736kbC++14551b2023-05-24 10:33:522023-05-24 10:33: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-05-24 10:33:55]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3736kb
  • [2023-05-24 10:33:52]
  • 提交

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