QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#88862#3002. Busy BoardXZTmaxsmall67WA 11ms5608kbC++14899b2023-03-17 20:03:462023-03-17 20:03:49

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-17 20:03:49]
  • 评测
  • 测评结果:WA
  • 用时:11ms
  • 内存:5608kb
  • [2023-03-17 20:03:46]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1e3+100;
int n,m;
char s[N][N],t[N][N];
int cntr[N],cntl[N];
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)scanf("%s",s[i]+1);
	for(int i=1;i<=n;i++)scanf("%s",t[i]+1);
	auto check=[&]()->bool{for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)if(t[i][j]&&s[i][j]!=t[i][j])return 0;return 1;}; 
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			cntl[j]+=t[i][j]=='X',cntr[j]+=t[i][j]=='X';
	if(check())return puts("1"),0;
	while(1)
	{
		int px=0,py=0;
		for(int i=1;i<=n;i++)
			for(int j=1;j<=m;j++)
				if(cntl[i]==1&&cntr[j]==1){px=i,py=j;break;}
		if(!px)break;cntl[px]--;cntr[py]--;
		for(int i=1;i<=n;i++)t[i][py]=0;
		for(int j=1;j<=m;j++)t[px][j]=0;
	}
	int tot=0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)if(s[i][j]=='O'&&!t[i][j])tot=1;
	if(check())return puts("1"),0;
	puts("0");
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 4ms
memory: 4952kb

input:

769 998
OOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOO...

output:

0

result:

ok answer is 0

Test #2:

score: 0
Accepted
time: 11ms
memory: 5608kb

input:

977 998
OOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOO...

output:

0

result:

ok answer is 0

Test #3:

score: -100
Wrong Answer
time: 3ms
memory: 5572kb

input:

941 973
XOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXOXXXXXXXOXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

0

result:

wrong answer expected 1, found 0