HDU 5088 Revenge of Nim II 高斯消元(异或,矩阵秩)

HDU 5088
题意:给出序列a,问是否能删除若干个数,使得序列的异或和为0(不能全部删除)
n<=1e3,a[i]<=1e12.


序列a如果有子集异或和为0 则有解,删除该子集以外的即可.否则无解.
将每个数用二进制写成一行 现在有一个n*40矩阵.

异或消元化成阶矩阵时,若a[i][i]为0,则不管,若矩阵异或消元后有非0行 则有解.


有非0行 等价于矩阵不是满秩的 n*40矩阵的秩最大为min(n,40).

n>40时 矩阵一定不是满秩的 直接输出yes.

n<=40时,高斯消元判定是否满秩(求非零行个数) O(40^3).

#include 
using namespace std;
typedef long long ll;
const int N=1e3+5;
const double eps=1e-9;
int n,a[N][45],m=41;
void Gauss()
{
    int row=0,col=0,j,k,r;
    while(row>T;
    while(T--)
    {
        scanf("%d",&n);
        for(int i=0;i>j)&1;
        }
        if(n>40)
            printf("Yes\n");
        else
            Gauss();
    }
    return 0;
}



你可能感兴趣的:(HDU,数学,------,高斯消元)