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

建议使用的浏览器:

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

3604:The N cubes puzzle

题目描述
Given n cubes 1*1*1 (x, y, z) and n types of pigments . You can choose any one of the n pigments to paint every face of these cubes as you want. To save space, we’d like you to stack these n cubes vertically into a 1*1*n cube. What’s more, to make it as much beautiful as possible, we demand you to find a painting way to make sure that all the vertical faces of the resulting cube are covered by n colors.
For example, such as n = 4, a cube's expand map just as sample 1-1 ;and the stacked cube's expand map just as sample 1-2;
    
输入解释
The first line is an integer T (1<=T<=500) indicating the number of test cases.
Each test case begins with an integer n (1<=n<=10), which stands for the number of cubes. Then, the following 3 * n lines each contains a string which only consists of capital letters between 'A' and 'A' + n - 1 (colors of the pigments, 1<=n<=10). Pay attention, each cube occupies 3 lines describing its expanded map.
输出解释
For each case, print a line formatted as "Case #ID: ", where ID (starting from 1) is the number of current test case. Then, if it’s possible to find a feasible solution, please output "Yes”, or please output "No".
输入样例
3
2
 A
BBAA
 B
 B
ABBA
 A 
3
 A
ABAB
 B
 C
AACB
 C
 C
ABBC
 C
4
 A
ADCB
 A
 A
ADBC
 D
 C
BBAD
 C
 B
CDAC
 D
输出样例
Case #1: Yes
Case #2: No
Case #3: Yes
来自杭电HDUOJ的附加信息
Author Jsky
Recommend lcy

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

源链接: HDU-3604

最后修改于 2020-10-25T23:05:10+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)