You have four colored cubes. Each side of each cube is a single color, and there are four colors: blue (B), red (R), green (G) and yellow (Y) Describing the six faces as front, back, left, right, top, bottom, the cube colors are:Cube Front Back Left Right Top Bottom 
1 R B G Y B Y 
2 R G G Y B B 
3 Y B R G Y R 
4 Y G B R R R The objective is to find ways to stack the four cubes as a vertical column so that each side of the column is showing all four colors.
In a compiled language of your choice, write a program to find all successful permutations.

解决方案 »

  1.   

    cube可以旋转吗 就是标为Front的面可以变为Top吗
      

  2.   

    每行分成3块 1 R B| G Y| B Y 
    1、忽略上下 前面可以换到后面而不影响左右 左边可以换到右边也不影响前后 因为只要上下翻转一次就可以了2、块与块之间位置可换 左右跟前后位置互换 上下可以跟左右换 上下还可以跟前后换3、只要找出后4个位置满足行元素不同 列元素不同就可以了怎么感觉像线性代数的求解 忘了