Who's Aunt Zhang(hdu4633,polay定理)

73 篇文章 0 订阅
5 篇文章 0 订阅

http://acm.hdu.edu.cn/showproblem.php?pid=4633

Who's Aunt Zhang

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 180    Accepted Submission(s): 146

Problem Description

Aunt Zhang, well known as 张阿姨, is a fan of Rubiks cube. One day she buys a new one and would like to color it as a gift to send to Teacher Liu, well known as 刘老师. As Aunt Zhang is so ingenuity, she can color all the cubes points, edges and faces with K different color. Now Aunt Zhang wants to know how many different cubes she can get. Two cubes are considered as the same if and only if one can change to another ONLY by rotating the WHOLE cube. Note that every face of Rubiks cube is consists of nine small faces. Aunt Zhang can color arbitrary color as she like which means that she doesnt need to color the nine small faces with same color in a big face. You can assume that Aunt Zhang has 74 different elements to color. (8 points + 12 edges + 9*6=54 small faces)

 

Input

The first line of the date is an integer T, which is the number of the text cases.

Then T cases follow, each case contains one integer K, which is the number of colors. T<=100, K<=100.

 

Output

For each case, you should output the number of different cubes.

Give your answer modulo 10007.

 

Sample Input

3

1

2

3

 

Sample Output

Case 1: 1

Case 2: 1330

Case 3: 9505

 

Source

2013 Multi-University Training Contest 4

 

Recommend

zhuyuanchen520

 

解析:

思路:利用polay定理和置换群求解方案数

直接用了以下这个大神的结论过的;

http://blog.csdn.net/huangshenno1/article/details/9708207

根据Burnside引理,等价类数目等于所有 的不动点数目 C ( f ) 的平均值。

本题模型共有4大类置换,共24种:

1. 不做任何旋转 K ^ (54 + 12 + 8)

2. 绕相对面中心的轴转

1) 90度 K ^ (15 + 3 + 2) * 3

1) 180度 K ^ (28 + 6 + 4) * 3

1) 270度 K ^ (15 + 3 + 2) * 3

3. 绕相对棱中心的轴转

1) 180度 K ^ (27 + 7 + 4) * 6

4. 绕相对顶点的轴转

1) 120度 K ^ (18 + 4 + 4) * 4

1) 240度 K ^ (18 + 4 + 4) * 4

0MS 228K 586 B C++

*/


#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
const int mod=10007;
int pow_mod(int a,int b)
{
if(b==0)
return 1;
int x=pow_mod(a,b/2);
long long ans=(long long)x*x%mod;
if(b%2==1)
ans=ans*a%mod;
return (int)ans;
}
int main()
{
int T,k,ans,c=0;
scanf("%d",&T);
while(T--)
{
scanf("%d",&k);
 ans=(pow_mod(k,74)+pow_mod(k,20)*6+pow_mod(k,38)*9+pow_mod(k,26)*8)%mod;
// printf("%d\n",ans);
 ans=(ans*pow_mod(24,mod-2))%mod;
 printf("Case %d: ",++c);
 printf("%d\n",ans);
}
return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值