异或方程组高斯消元模板
inline void solve (int n) {
for (int i = 1, top = 1; i <= n; i ++, top ++) {
int cur = 0;
for (int j = top; j <= n; j ++)
if (mat[j][i]) {
cur = j;
break;
}
if (!cur) {
top --;
ans = 2ll * ans % MOD;
continue;
}
if (cur != top) swap(mat[cur], mat[top]);
for (int j = 1; j <= n; j ++)
if (top != j && mat[j][i]) mat[j] ^= mat[top];
}
}

浙公网安备 33010602011771号