Determinant of boolean matrix
Execution time limit is 3 seconds
Runtime memory usage limit is 256 megabytes
You are given the last rows of an boolean matrix . Your task is to determine boolean values for the first row such that is maximized (see notes). You only need to output the value of .
Input
The first line contains integer .
Lines through contain numbers each: line containing the numbers (either or ) in the row of .
Output
Output non-negative integer on the single line.
Examples
is a boolean matrix iff ,
The determinant of an matrix , denoted , is a scalar that is defined inductively as:
Where is the matrix obtained from by deleting the row and column containing
= The remainder of division of by B.
Input #1
Answer #1
Input #2
Answer #2
Submissions 6
Acceptance rate 33%