#P14901. [ICPC 2018 Yokohama R] Ranks
[ICPC 2018 Yokohama R] Ranks
题目描述
A finite field consists of two elements: and . Addition and multiplication on are those on integers modulo two, as defined below.
A set of vectors over with the same dimension is said to be linearly independent when, for , $c_1 \mathbf{v}_1 + \cdots + c_k \mathbf{v}_k = \mathbf{0}$ is equivalent to , where is the zero vector, the vector with all its elements being zero.
The rank of a matrix is the maximum cardinality of its linearly independent sets of column vectors. For example, the rank of the matrix $\begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & 1 \end{bmatrix}$ is two; the column vectors and (the first and the third columns) are linearly independent while the set of all three column vectors is not linearly independent. Note that the rank is zero for the zero matrix.
Given the above definition of the rank of matrices, the following may be an intriguing question. How does a modification of an entry in a matrix change the rank of the matrix? To investigate this question, let us suppose that we are given a matrix over . For any indices and , let be a matrix equivalent to except that the entry is flipped.
$$A^{(ij)}_{kl} = \begin{cases} A_{kl} + 1 & (k = i \text{ and } l = j) \\ A_{kl} & (\text{otherwise}) \end{cases}$$In this problem, we are interested in the rank of the matrix . Let us denote the rank of by , and that of by . Your task is to determine, for all entries, the relation of ranks before and after flipping the entry out of the following possibilities: (i) , (ii) , or (iii) .
输入格式
The input consists of a single test case of the following format.
$$\begin{aligned} & n \; m \\ & A_{11} \ldots A_{1m} \\ & \vdots \\ & A_{n1} \ldots A_{nm} \end{aligned}$$and are the numbers of rows and columns in the matrix , respectively (, ). In the next lines, the entries of are listed without spaces in between. is the entry in the -th row and -th column, which is either or .
输出格式
Output lines, each consisting of characters. The character in the -th line at the -th position must be either (minus), (zero), or (plus). They correspond to the possibilities (i), (ii), and (iii) in the problem statement respectively.
2 3
001
101
-0-
-00
5 4
1111
1000
1000
1000
1000
0000
0+++
0+++
0+++
0+++
10 10
1000001001
0000010100
0000100010
0001000001
0010000010
0100000100
1000001000
0000010000
0000100000
0001000001
000-00000-
0-00000-00
00-00000-0
+00000+000
00-0000000
0-00000000
000-00000-
0-000-0-00
00-0-000-0
+00000+000
1 1
0
+