|
||||||||||
Squiggly SudokuTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2280 Accepted Submission(s): 956 Problem Description Today we play a squiggly sudoku, The objective is to fill a 9*9 grid with digits so that each column, each row, and each of the nine Connecting-sub-grids that compose the grid contains all of the digits from 1 to 9. Left figure is the puzzle and right figure is one solution. Now, give you the information of the puzzle, please tell me is there no solution or multiple solution or one solution. Input The first line is a number T(1<=T<=2500), represents the number of case. The next T blocks follow each indicates a case. Each case contains nine lines, Each line contains nine integers. Each module number tells the information of the gird and is the sum of up to five integers: 0~9: '0' means this gird is empty, '1' - '9' means the gird is already filled in. 16: wall to the up 32: wall to the right 64: wall to the down 128: wall to the left I promise there must be nine Connecting-sub-grids, and each contains nine girds. Output For each case, if there are Multiple Solutions or no solution just output "Multiple Solutions" or "No solution". Else output the exclusive solution.(as shown in the sample output) Sample Input
Sample Output
Source | ||||||||||
|