搞了半天才明白为什么异或方程组求解可以直接套高斯消元。。
看了往上bolg几乎都没有提这点。。(我感觉这地方才是最难的)
其实异或方程组求解直接套高斯消元是有条件的:未知数必须是2的次幂(0,1,2,4,这种)
只有这样才满足 a*x ^ b*x == (a ^ b ) * x ;这样两个方程就可以异或消去未知数了。
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const double PI= acos(-1.0);
const int M = 1e5+7;
/*
int head[M],cnt;
void init(){cnt=0,memset(head,0,sizeof(head));}
struct EDGE{int to,nxt,val;}ee[M*2];
void add(int x,int y,int z){ee[++cnt].nxt=head[x],ee[cnt].to=y,ee[cnt].val=z,head[x]=cnt;}
*/
int a[35][35];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin>>t;
while(t--)
{
int n,x,y;
cin>>n;
memset(a,0,sizeof(a));
for(int i=1;i<=n;i++)cin>>a[i][n&