QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#88868#3002. Busy BoardXZTmaxsmall67WA 13ms5500kbC++14904b2023-03-17 20:16:022023-03-17 20:16:03

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:16:03]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:5500kb
  • [2023-03-17 20:16:02]
  • 提交

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[i]+=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()&&tot)return puts("1"),0;
	puts("0");
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 11ms
memory: 5032kb

input:

769 998
OOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOO...

output:

0

result:

ok answer is 0

Test #2:

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

input:

977 998
OOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOO...

output:

0

result:

ok answer is 0

Test #3:

score: -100
Wrong Answer
time: 13ms
memory: 5384kb

input:

941 973
XOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXOXXXXXXXOXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

0

result:

wrong answer expected 1, found 0