HOJ Megaminx

Megaminx

My Tags   (Edit)
  Source : fishcanfly
  Time limit : 1 sec   Memory limit : 64 M

Submitted : 59, Accepted : 47

Megaminx is a dodecahedron-shaped puzzle. It has a total of 50 movable pieces, and a 12-color Megaminx has altogether 957,857,577,548,787,197,453,498,274,575,234,123,386,619,100,100,295,123,123,123,100,669,616,553,523,347,122,516,
032,313,645,505,168,688,116,411,019,768,627,200,000,000,000 different positions.[Wikipedia] See the picture below. Interesting, hah!

Note that a dodecahedron is a shape with 12 sides of pentagons.

Do not be scared. Let's think of a much simpler problem. Given a dodecahedron and n different colors, if we are allowed to paint each side with a single color, how many different dodecahedrons can we get? Note that if two dodecahedrons can be transformed to each other with finite steps of rotation, they will be considered as identical.

HOJ Megaminx_第1张图片

Input

Multiple test cases. Each test case contains only one line of a single integer n(1 ≤ n ≤ 13) as described above. Process to the end of file.

Output

For each test case, print a line containing only a single number, which is the number of different dodecahedrons.

Sample Input

1
2
3

Sample Output

1
96
9099

此题是第一个文章的加强版,面数变为12。如果不给出图的话,我估计我是做不出来的,解题思路同第一篇文章。接下来我来给出具体的求解过程:

(1)不动置换为:m^12

(为下面做一下铺垫:设顶点为:p个,边为:q个,面为:f个。f=12,q=5*12/2=30,由欧拉公式:p-q+f=2得:p=20个)

(2)中心对称轴有三种:

第一:对面的中心连线为第一种:

一共f/2=6对对面,即会有六个中心对称轴,每个对称轴能旋转4个角度,由于上下的面个数分布为:1,5,5,1,画一下你会发现5个面无论怎么转还是一个置换群,即为m^4。

那么就是:6*4*m^4=24*m^4

第二:对边中心的连线为第二种:

这样的对称中心轴有:q/2=15个,每个轴职能旋转1个角度180度,那么就是对称位置的交换,一共6对对换群,即m^6。

最后共:15*m^6

第三:对顶点的连线为第三种:

这样的对称中心轴有:p/2=10个,观察面的分布为:3,6,3即每个轴只能有2个旋转角度。由于3个元素的置换群数不会增加,6个在两个角度下都是分为2个,即:m^4.

最后共:10*2*m^6=20*m^4.

最后综合上述的1,2,3得出总的和为:m^12+24*m^4+15*m^6+20*m^4

=m^6+15*m^6+44*m^4

同样注意一下范围,代入公式即可。

你可能感兴趣的:(polya置换)