5. In each cell of a $6 \times 6$ table, numbers +1 or -1 were placed such that the product of all numbers in any row and any column is positive. In how many ways can this be done?
Solution. Fill a $5 \times 5$ square with numbers +1 and -1 arbitrarily. Choose the numbers in the last column so that the product in the first 5 rows is positive, and similarly choose the numbers in the last row for the first 5 columns so that the product is positive. It remains to choose the last number.

Let the numbers in the last column, except for the cell with coordinates $(6,6)$, be $a_{1}, \ldots, a_{5}$. And the numbers in the last row, except for the cell with coordinates $(6,6)$, be $b_{1}, \ldots, b_{5}$, and the number in the cell with coordinates $(6,6)$ be $c$.

Multiply the first 5 rows and the first 5 columns, we get a positive number due to the choice of the last row and the last column. On the other hand, this product is equal to the product $a_{1} \cdot a_{2} \cdot \ldots \cdot a_{5} \cdot b_{1} \cdot b_{2} \cdot \ldots \cdot b_{5}$. Therefore, this product is positive, i.e., $a_{1} \cdot a_{2} \cdot \ldots \cdot a_{5}$ and $b_{1} \cdot b_{2} \cdot \ldots \cdot b_{5}$ have the same sign. If $a_{1} \cdot a_{2} \cdot \ldots \cdot a_{5}>0$, then $c=1$, if $a_{1} \cdot a_{2} \cdot \ldots \cdot a_{5}<0$, then $c=-1$.

Thus, if the $5 \times 5$ square is filled, then the $6 \times 6$ square is uniquely determined, and the $5 \times 5$ square can be filled with numbers +1 and -1 in $2^{25}$ ways.