当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7189:3D Puzzles

题目描述
Klee likes toys. Klee's mom, Alice bought her a new toy from Sumeru.

The toy is a $4\times 4\times 4$ cube. The cube can be divided into $13$ different parts of the blocks.

The $13$ blocks are shown in the figure.



Each block can be placed anywhere in the cube, but cannot overlap.

Klee can freely rotate the blocks and use a kind of magic, mirror magic. After using mirror magic, the blocks will flip symmetrically. For example, block F is shown in the figure after using mirror magic.



At the beginning, Alice has put some blocks in place. Klee needs to put the remaining blocks into a $4\times 4\times 4$ cube.

Using Astrology, Alice knew the number of solutions will not exceed $500$.

Klee wants to know all the solutions of this puzzle, but it is too difficult for Klee. Please help her.
输入解释
Each test contains multiple test cases. The first line contains the number of test cases $T(1 \le T \le 10)$. Description of the test cases follows.

There are $16$ lines in a case. Each line contains a string of $4$ characters. Every $4$ lines describe one layer of the cube from top to bottom.

Each input character may only be upper-case letters from "A" to "M" or ".".

"A" to "M" are indicating the blocks in the figure above and "." are indicating the position is empty.
输出解释
For each test case:

If it's impossible to solve the puzzle, print "No Solution!" in a single line (without quotes).

Otherwise, print the number of solutions in the first line.

Then for each solution, print $16$ lines. Each line contains a string of $4$ characters. Every $4$ lines describe one layer of the cube from top to bottom.

Each input character may only be upper-case letters from "A" to "M", indicating the blocks in the figure above.

The output format of block is the same as input.

If there are multiple solutions, print them in the lexicographical order.
输入样例
2
E...
EEE.
E...
...L
E...
....
....
...L
JJ..
GJ..
GII.
HIIL
JJ..
JJ..
GII.
HIIM
E...
EEE.
E...
...L
E...
....
....
...L
JJ..
GJ..
G...
H..L
JJ..
JJ..
G...
H..M
输出样例
1
ECCC
EEEC
EDDD
BDDL
ECKK
AAAA
BDDA
BBBL
JJKK
GJFA
GIIA
HIIL
JJKK
JJFF
GIIF
HIIM
2
ECCC
EEEC
EDDD
BDDL
ECKK
AAAA
BDDA
BBBL
JJKK
GJFA
GIIA
HIIL
JJKK
JJFF
GIIF
HIIM

EKKK
EEEA
EBBA
DDBL
EKKK
AAAA
DDBA
DDDL
JJII
GJII
GFBC
HFFL
JJII
JJII
GCCC
HCFM
来自杭电HDUOJ的附加信息
Hint 3D Model for the first example.Download and open it with paint 3D.https://share.weiyun.com/5iX1150Z

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7189

最后修改于 2022-09-15T06:17:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
8000/4000MS(Java/Others) 524288/262144K(Java/Others)