Given $N \times M$ matrix $A$, a size $N$ vector $b$. Please calculate a (size $M$) vector $x$ s.t. $Ax = b$. We consider everything $\mathbb{F}_ {2}$.
For the input and output of matrices and vectors, please treat each row as a string concatenated with its components ($0$ or $1$).
$N$ $M$
$A_ {0,0}A_ {0,1}\cdots A_ {0,M-1}$
$A_ {1,0}A_ {1,1}\cdots A_ {1,M-1}$
$\vdots$
$A_ {N-1,0}A_ {N-1,1}\cdots A_ {N-1,M-1}$
$b_ 0b_ 1\cdots b_ {N-1}$
If there is no solution, print
-1
and if exists, print as follows.
$R$
$c_ 0c_ 1\cdots c_ {M-1}$
$d_ {0,0}d_ {0,1}\cdots d_ {0,M-1}$
$\vdots$
$d_ {R-1,0}d_ {R-1,1}\cdots d_ {R-1,M-1}$
We note that $R$ is the rank of solution. $c_ i$ is one of the solution. For each $j$, $d_ {j,0}\cdots d_ {j,M-1}$ is the basis of solution.
3 3 101 011 110 011
1 010 111
3 3 101 011 110 111
-1
1 3 111 1
2 100 110 101
| No. | Testdata Range | Score |
|---|