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

建议使用的浏览器:

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

2691:2-Dimensional Rubik's Cube

题目描述
Alex loves Rubik's Cube. The 3-dimensional cubes are so difficult that Alex can only challenge the 2D ones, which have
six colors: W, Y, R, O, G, B.

Alex names the six faces as U(upper), D(bottom), L(left), R(right), F(front), B(back). The expanded cube will appear like
this:

Alex is able to rotate any face 90 degrees in clockwise or counter-clockwise in a second. U, D, L, R, F, B are used for rotating the
corresponding face in clockwise, while U', D', L', R', F', B' are for counter-clockwise.

Now Alex got a Cube, he wants to know the minimum number of steps required for making one state to the other.
输入解释
The input consists of multiple test cases. The first line of input contains an integer T, which is the number of
test cases.

Each test case is on 12 lines. The first 6 lines indicate the initial state, while the next 6 lines indicate the destination state,
both according to the form of the sample input.

[Technical Specification]
T is an integer, and T <= 10.
You can assume that it is always possible to complete the task.
输出解释
For each test case, print the minimal steps required on a single line.
输入样例
1 
    G W 
    Y G 
W G O Y R B O R 
Y B R W G B O B 
    W O 
    R Y 
    B B 
    B B 
O O W W R R Y Y 
O O W W R R Y Y 
    G G 
    G G 
输出样例
10 
来自杭电HDUOJ的附加信息
Recommend yifenfei

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

源链接: HDU-2691

最后修改于 2020-10-25T22:55:57+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
30000/10000MS(Java/Others) 65536/65536K(Java/Others)