问题
The problem is:
Given a matrix of dimensions N*M with only K cells filled. You are required to fill rest of the cells with values ranging from 0 to 2^30-1 such that:
- the xor of the 4 corner cell elements equals 0.
- (1) is satisfied by every sub-matrix of dimensions p*q where p>1 and q>1.
What I could think about it was given any unfilled cell I can check if it is a corner element for any sub-matrix for which other three corners are filled. For all other cases we can work with cases: one of the unfilled cells can take any value and we see how many ways can the other unfilled cells be filled by processing the same thing above.
I am not even sure if this works, and even if it works the time complexity should be very high. What efficient solutions are available for this question?
来源:https://stackoverflow.com/questions/61062518/fill-a-partially-filled-matrix-such-that-xor-of-4-corner-elements-of-all-its-sub