魔方吧·中文魔方俱乐部

标题: 一道关于三阶魔方置换周期的题目 [打印本页]

作者: xh176233756    时间: 2009-6-7 12:30:41     标题: 一道关于三阶魔方置换周期的题目

http://acm.hust.edu.cn/thx/problem.php?id=1229

来挑战下吧!~





Periodic Operation

Time Limit: 10 Sec  Memory Limit: 128 MB
Submissions: 23  Solved: 5

Description
Rubik's Cube is one of the most popular toys in the world. The job of recovering 6 faces is interesting. Now it can be solved by computer very efficiently, but this time I won't give you such a hard assignment.

A Rubik's Cube player may find that any series of certain operations on a Cube is periodic, which means that given a series of operations, if performed on a recovered cube successively for a certain times, the cube will be recovered again. The minimum number of times required is called the period of that series of operations.

Now you are asked to calculate the period of some given series of operations.

  
Input
Input terminates with EOF.
Each case has a line describing the series of operations.
Any series is composed of unit operations of the following 18 ones:
U U' U2 R R' R2 F F' F2
D D' D2 L L' L2 B B' B2
Any two operations is separated by a space.
Any series has no more than 100 operations and no less than 1 operation.
The function of the above operation is explained in the following figure:

  
Output
For each case output one number indicating the period in one line.


Sample Input
F
R2 R2
U R' U' R

Sample Output
4
1
6

HINT
1. Before scrambling, each face of the cube has a unique color.
2. The cube is recovered when any face is composed of only one color.

[ 本帖最后由 xh176233756 于 2009-6-7 19:44 编辑 ]
作者: 蚂蚁儿    时间: 2009-6-7 12:33:58

还是别给连接呀楼主,直接上吧里多好的
作者: 夜雨听风    时间: 2009-6-7 12:36:58

定下在看~!!

!!!
作者: 夜雨听风    时间: 2009-6-7 12:37:45

麻烦翻译下

偶英语不太好
作者: 夜雨听风    时间: 2009-6-7 12:38:15

对于这类题目我很感兴趣

就是英语
作者: xdgtzsyyj    时间: 2009-6-7 12:45:35

网页打不开
作者: 77880066    时间: 2009-6-7 12:50:41

全英文,看不懂,等翻译啊
作者: yq_118    时间: 2009-6-7 13:10:08

麻烦问题直接给出了2
作者: 骰迷    时间: 2009-6-7 13:43:57

我也打不開,誰能貼上來
作者: kexin_xiao    时间: 2009-6-7 15:08:20

英文版的
作者: xh176233756    时间: 2009-6-7 15:08:22

其实就是给一个公式,求它的置换周期

[ 本帖最后由 xh176233756 于 2009-6-7 15:20 编辑 ]
作者: xh176233756    时间: 2009-6-7 15:21:43

呵呵,可能大大们觉得不难吧。。
主要是看编码能力了。。。
作者: zxl0714    时间: 2009-6-7 15:55:01

单纯的麻烦而已。。。。谁出的这么麻烦的题
作者: yq_118    时间: 2009-6-7 16:31:10

英语不懂,麻烦翻译一下
作者: 夜雨听风    时间: 2009-6-7 16:35:39

麻烦LZ翻译下
作者: 夜雨听风    时间: 2009-6-7 16:46:54

题目大意:
周期操作

时间限制: 10秒内存限制:使用128 MB
提交: 23解决: 5

描述
魔方是一个最流行的玩具在世界上。恢复工作的6所面临很有意思。现在可以解决电脑非常有效,但这个时候,我不会给你这样一个艰苦的任务。

阿魔方的球员可能会发现,任何一系列的某些业务上的立方体是定期,这意味着给予了一系列的行动,如果执行的立方体先后恢复了某些时候,立方体将再次恢复。最低数量所需时间称为时期的一系列行动。

现在请你计算期间的一些考虑一系列的行动。

   
输入
输入终止与EOF分析。
每个案件有一个行描述了一系列的行动。
任何系列组成单位业务的下列18个的:
U U' U2 R R' R2 F F' F2
D D' D2 L L' L2 B B' B2
任何两个行动以一个空格隔开。
没有任何系列100多个业务和不低于1作业。
的功能,上述行动中解释如下图:

  
输出
为每一个案件一个数字显示输出期间在同一行。


采样输入
F R2 R2 U R' U' R
示例输出
4
1
6

提示
1 。在争夺,每一面对立方体具有独特的颜色。
2 。立方体是在什么时候恢复面临组成只有一个颜色。
作者: 夜雨听风    时间: 2009-6-7 16:49:29

什么意思

翻译出来还是不懂
作者: xh176233756    时间: 2009-6-7 18:51:18     标题: 回复 13# 的帖子

呵呵我出的,写得好的话也不长,标程也就1.5K而已
作者: 骰迷    时间: 2009-6-7 19:11:42

不用,只要花些時間,把各個循環寫下來就是了
作者: 乌木    时间: 2009-6-7 20:06:38

看来是要读者编程,求出所输入的公式的重复周期n--连做n遍公式后魔方复初。
比如,文中给出的例子是:
Sample Input
F
R2 R2
U R' U' R

Sample Output
4
1
6

意思是,如果输入F,输出n=4 。即,FFFF,做四遍,魔方复初。
若输入R2 R2,输出n=1。即,R2 R2 ,做一遍,魔方复初。
若输入U R' U' R,输出n=6 。意思是(U R' U' R)6,魔方复初。
作者: Cielo    时间: 2009-6-7 20:47:04

我记得吧里有帖子介绍过一个软件(也许是网页版的),就是用来算公式周期的。
作者: yq_118    时间: 2009-6-7 21:01:03

按盲拧编码,然后就出来了
作者: superacid    时间: 2009-6-8 08:33:42

16楼翻译得太不通顺了吧
作者: superacid    时间: 2009-6-8 08:36:45

原题要求你计算多个魔方公式的置换周期。
每个公式不多于100步。




欢迎光临 魔方吧·中文魔方俱乐部 (http://bbs.mf8-china.com/) Powered by Discuz! X2