QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#341951#313. Equation Mod 2Kevin5307#WA 2ms3676kbC++20644b2024-02-29 23:25:182024-02-29 23:25:18

Judging History

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

  • [2024-02-29 23:25:18]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3676kb
  • [2024-02-29 23:25:18]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
bitset<5005> bs[5005];
int ans[5005];
int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=m;i++)
		for(int j=1;j<=n+1;j++)
		{
			int x;
			cin>>x;
			bs[i][j]=x;
		}
	int p=1;
	for(int i=1;i<=n&&p<=m;i++)
	{
		if(!bs[p][i])
			for(int j=p+1;j<=m;j++)
				if(bs[j][i])
				{
					swap(bs[p],bs[j]);
					break;
				}
		if(bs[p][i])
		{
			for(int j=1;j<=n;j++)
				if(j!=p&&bs[j][i])
					bs[j]^=bs[p];
			p++;
		}
	}
	for(int i=1;i<=m;i++)
		for(int j=1;j<=n;j++)
			if(bs[i][j])
				ans[j]=bs[i][n+1];
	for(int i=1;i<=n;i++)
		cout<<ans[i]<<" ";
	return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3676kb

input:

100 95
0 0 0 1 1 0 1 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 0 0 0 0 1 0 1 1 1 1 1 0 0 1 0 1 1 0 1 0 1
0 0 0 1 0 0 1 1 0 0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 0 1...

output:

0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 1 1 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 0 0 

result:

wrong answer incorrect solution