资 源 简 介
一个acm算法题目 问题描述: 有一个黑盒子,可视为一个15×10的二维矩阵,里面有一些空隙,在二维矩阵中用0表示空隙,用1表示被占有。现有一个仪器,可以从4个方向对盒子进行分行透视:从左到右,从左下到右上,从下到上,从右下到左上。透视可得到该二维矩阵的该行1的个数。要求,还原此矩阵。 输入:4行,每一行分别代表从左到右,从左下到右上,从下到上,从右下到左上透视所得的数据 输出:该矩阵 使用的方法是回溯法,具体见程序-a acm algorithm topic Problem description : a black box, as a 15 x 10 two-dimensional matrix, there are some gaps in two-dimensional matrix using 0 indicates the gap, with a show that occupies. An existing equipment, from the direction of four branches box for perspective : from left to right, from the lower left to upper right, from bottom to top, from the lower right to upper left. Perspective availability of the two-dimensional matrix of the line a number. Demand reduction of this matrix. Input : 4 firms on behalf of every line from left to right, from the lower left to upper right, from bottom to top, from the upper left to lower right perspective on data obtained from the output : the matrix method is the use of backtracking, see the specific procedures