I loved the part when she said “It’s cooking time!” And cooks everywhere, it really shows that she really cooks all the time.
Given a n x n board, each tile is either 1 or 0, you need to put n queens and count how many solutions are legal as the rules:
For example, the answer of the sample input is 1 as the picture below speaks for itself. There is no other possible move.
Little help from the queen: use scanf("%1d") to scan 1 digit number.
First line is an integer n (1 <= n <= 10)
The next n lines is the board state, each n digit, consist only number 1 and 0.
It's guaranteed that every row has atleast 1 number 0
Output an integer with how many solution the input has.
Following with '\n'