41int LinearEquation(vector<bitset<MAX_COL>> a, vector<
bool> b,
int col, vector<
bool>& x0, vector<vector<
bool>>& ker) {
43 assert(b.size()==row);
45 vector<bitset<MAX_COL>> a2(row);
46 for(
int i=0; i<row; i++) {
48 for(
int j=0; j<col; j++) a2[i][j]=a[i][j];
49 if(b[i]) a2[i][col]=
true;
53 int rank=RowReduction<MAX_COL>(a2,col+1,where);
55 for(
int r=rank; r<row; r++)
if(a2[r][col])
return false;
57 x0=vector<
bool>(col,
false);
58 for(
int i=0; i<rank; i++) x0[where[i]]=a2[i][col];
61 for(
int c=0; c<col; c++) {
62 if(r<rank && c==where[r]) {
68 for(
int r2=0; r2<r; r2++) x[where[r2]]=a2[r2][c];
71 if (ONE_KER)
return true;
int RowReduction(vector< bitset< MAX_COL > > &a, int col, vector< int > &where)
F_2 上の連立線形方程式 https://mathlandscape.com/solution-sp/ https://yukicoder.me/submissions/1011997 verify:...