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

建议使用的浏览器:

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

5836:Rubik's Cube

题目描述
As we all know, Zhu is the wisest man. When Liao was ninety-nine years old, the Zhu appeared to him and said, "I am God Almighty; walk before me and be blameless.

I will confirm my covenant between me and you and will greatly increase your wisdom." At that time, Liao has a problem:

Liao has a Rubik's Cube and the surfaces of it are drawn as black or white. He can rotate it as the rules of the Rubik's Cube. Liao asked Zhu:"how many states the Rubik's Cube can reach?"

Zhu is omniscient and omnipotent, but he did not tell the answer. Can you tell the poor man the answer? Remember two states are regarded as the same one if you change views and find the two states is the same one.

For those of you unfamiliar with the puzzle, a Rubik's Cube, comes in the form of a cube where each face is divided into three rows and three columns (nine "squares". Any of the six faces of the cube may be rotated either clockwise or counterclockwise, which also rotates the three nearest squares on each adjoining face onto a new face, respectively.

输入解释
Intput contains multiple test cases.

The first line is an integer $1 \leq T \leq 10$, the number of test cases.

Each case begins with an integer $n$, indicating the number of the squares of blacks.

The next line contains $n$ integers $a_1 , a_2 ,.., a_n$, representing squares indexed as $a_1,a_2,..,a_n$ are black respectively. All $a_i$ are defferent. The indexes of squares are showed in the pictures. $(0 \leq n \leq 5, 0 \leq a_i \leq 53)$.
输出解释
For each test case,output a single line "Case #x: y", where x is the case number, starting from 1. And y is the answer.
输入样例
3
2
0 47 
2
24 53 
2
36 46
输出样例
Case #1: 15
Case #2: 15
Case #3: 24
来自杭电HDUOJ的附加信息
Author UESTC
Recommend wange2014

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

源链接: HDU-5836

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

共提交 0

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