Editorial for TLE '16 Contest 3 P4 - Gaussian Elimination
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
For the first subtask, we can simply try all possible combinations of
Time Complexity:
For the second subtask, we need to make several observations for this problem. First, when we perform a row or column reduction, we compress the entire grid into a new continuous grid after the move. This means that no matter which row we remove, the end state will be the same. The same applies for the columns. Thus, the only decision that matters is whether to perform a row or a column reduction.
Now we need to apply some game theory knowledge. Let
Time Complexity:
To solve the third subtask, we need to notice a pattern with the DP array since generating the entire DP array is too time-consuming. Again, if
Note: This solution can be proven correct with induction. The proof of correctness is left as an exercise.
Time Complexity:
Comments