#P3701. Rubik's Cube: 0-1 Version
Rubik's Cube: 0-1 Version
Description
Rubik's Cube is one of the most popular toys in the world. For convenience, let's mark the six faces by 1 to 6 and its expanded view is illustrated in Fig-1. Fig-2 shows the 18 possible moves. This problem considers a variation of Rubik's Cube. In our cube, the 54 stickers are marked by either 0 or 1, instead of six colors. Given the expanded view of a cube, your task is to take several moves that makes all the stickers marked by 1 located on the face marked by 1.
Fig-1
Fig-2
Input
The expanded view of the cube.
Output
Print “yes” or “no” in the first line to indicate “the task could be done” or “the task is impossible”. When “yes” is printed, the second line should be an integer T, the number of moves you take. The following T lines describe your moves by its number as in Fig-2. Any answer with T ≤ 10000 is available.
000
000
000
000100000000
000100000000
000100000000
011
011
011
Sample Output
yes
1
8
Source
POJ Founder Monthly Contest – 2008.10.05, withleave
</p>