Theme: 3 * 3 matrix with white block (0) and black (1), give each column in a row of black block number, deduce the style of this matrix (one and only subject to ensure matrix), in particular, if input 11, is between two black pieces of a white block,
I think available DFS search, but not too will write code, you who can help with?
The sample input: 11 1 11 1
The sample output: 1 0 0 1 0 1 1 0 0
CodePudding user response:
Permutation and combination can The first line has a 1, 001010101 three The second line has two 1, 110101011 three, interval 0 only 101 in a The third line has a 1, 001010101 three The above each selected groups, and then determine whether each column to meet the input conditions can