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

建议使用的浏览器:

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

1448:Cube

题目描述
After many years of development, Merck has finally discovered a simple model which helps with computer aided drug design. Different chemical substances are viewed as two-dimensional 損uzzle? pieces which may be combined in a three-dimensional way, forming more complex structures of atoms. Special combinations of these pieces have very special chemical properties. These combinations which are known as ACM (Anachronistic Cube Molecules) result from combining six individual puzzle pieces along their edges to form a complete cube (see Figure 3).

Given six pieces, decide whether they can be put together to form a cube of dimension 6 * 6 * 6, with no holes visible from the outside. Each piece can be thought of as being cut from a plate of wood of dimension 6 * 6 * 1, with the 4 * 4 * 1 plate in the centre untouched. A piece can be used the one or the other way around, i.e., there is no distinction between the inside and the outside.
输入解释
The first line contains the number of scenarios.

In each scenario, you are first given six lines with a graphical representation of the six pieces. In that representation, "X" symbolises solid wood, a dot "." stands for a 1 * 1 * 1 piece of wood that was cut out. A column with "!" stands on the right of each piece to separate them from each other. There is a blank line following every scenario.

It is not necessary that the pieces can really be cut out of wood or that they form a stable cube, as you can see in the sample input, second example.
输出解释
The output for every scenario begins with a line containing "Scenario #i:", where i is the number of the scenario starting at 1. In the next line print "Yes" or "No" depending on whether the given pieces can be put together to form a cube. Terminate the output for the scenario with a blank line.
输入样例
3
XX..XX!.X..X.!XX..XX!.X..X.!..XX..!..XX..!
XXXXXX!.XXXX.!XXXXXX!.XXXX.!.XXXX.!.XXXX.!
.XXXX.!XXXXXX!.XXXX.!XXXXXX!XXXXXX!XXXXXX!
.XXXX.!XXXXXX!.XXXX.!XXXXXX!XXXXXX!XXXXXX!
XXXXXX!.XXXX.!XXXXXX!.XXXX.!.XXXX.!.XXXX.!
XX..XX!.X..X.!XX..XX!.X..X.!..XX..!..XX..!

.XXXX.!.XXXX.!.XXXX.!.XXXX.!XXXXXX!X....X!
XXXXXX!.XXXX.!XXXXXX!.XXXX.!XXXXXX!.XXXX.!
XXXXXX!.XXXX.!XXXXXX!.XXXX.!XXXXXX!.XXXX.!
XXXXXX!.XXXX.!XXXXXX!.XXXX.!XXXXXX!.XXXX.!
XXXXXX!.XXXX.!XXXXXX!.XXXX.!XXXXXX!.XXXX.!
......!......!......!......!XXXXXX!X....X!

......!......!......!......!......!......!
.XXXX.!.XXXX.!.XXXX.!.XXXX.!.XXXX.!.XXXX.!
.XXXX.!.XXXX.!.XXXX.!.XXXX.!.XXXX.!.XXXX.!
.XXXX.!.XXXX.!.XXXX.!.XXXX.!.XXXX.!.XXXX.!
.XXXX.!.XXXX.!.XXXX.!.XXXX.!.XXXX.!.XXXX.!
......!......!......!......!......!......!
输出样例
Scenario #1:
Yes

Scenario #2:
Yes

Scenario #3:
No

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-1448

最后修改于 2020-10-29T06:04:27+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000