1 人解决,1 人已尝试。
1 份提交通过,共有 2 份提交。
9.9 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
There was once a 3 by 3 by 3 cube built of 27 smaller cubes. It has fallen apart into seven pieces:
You are to write a program that outputs all possibilities of assembling the cube but suppress solutions that are mere rotations of another solution.
Hint: Piece a is the only part that, by rotation and translation, cannot be transformed into itself. In order to avoid solutions that are mere rotations of an already found solution, you may restrict transformations of piece a to translations.
The input file has several test cases. Each test case indicates the initial position of piece a
. You can translate it, but you mustn’t rotate it.
For each solution found, your program should output a line containing the solution as a string. The string is a linearized form of the cube. Each letter stands for the piece filling out the corresponding space in the cube. It is linearized as follows:
The string consists of substrings representing the front, middle and back plane.
Each substring consists of substrings representing the top, middle and bottom row.
Each row substring consists of letters representing the left, middle and right cell.
The solutions in figure 2 would be represented like this:
adcaccaacddgbfgffedggbfebee
aababbadcffegfcddcfeeggedgc
It is very important that your program uses the naming convention given in figure 1 and linearizes the cube as explained above.
Print a blank line after each test case.
Figure 3: Positions of the cells in the string
Figure 3 again shows how the cells of the cube are linearized.
aa.a..a.................... .........a..a..aa..........
aababbadcggeffcddcgeegfedfc aababbadceffgdcgdceefedfggc ... aababbadcffegfcddcfeeggedgc adcaccaacfddfebgeeffdggbgeb ...
1 人解决,1 人已尝试。
1 份提交通过,共有 2 份提交。
9.9 EMB 奖励。