Who's Aunt Zhang(hdu4633,polay定理)
来源:互联网 发布:好用的补水乳液 知乎 编辑:程序博客网 时间:2024/05/16 18:41
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 Rubik’s 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 cube’s 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 Rubik’s cube is consists of nine small faces. Aunt Zhang can color arbitrary color as she like which means that she doesn’t 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引理,等价类数目等于所有 f 的不动点数目 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;}
- Who's Aunt Zhang(hdu4633,polay定理)
- HDU4633 Who's Aunt Zhang
- HDU 4633 Who's Aunt Zhang (Polya定理)
- Who's Aunt Zhang HDU
- HDU 4633 Who's Aunt Zhang (Polya定理+快速幂)
- hdu 4633 Who's Aunt Zhang(polya)
- hdu 4633 Who's Aunt Zhang polya计数法
- hdu 4633 Who's Aunt Zhang 【polya计数】
- hdu 4633 Who's Aunt Zhang(Burnside引理+乘法逆元)
- polay定理
- Polay定理总结
- polay定理总结
- 【POJ 2409】Let it Bead(Polay 定理)
- poj2409Let it Bead Polay定理
- wikioi2845 排序的代价 Polay定理
- who s me's who??
- 组合数学 polay定理 hud 2409 Let it Bead
- HDU-5868-Different Circle Permutation-Burnside定理和polay计数
- Velocity语法
- !!!Chapter 12 Advanced Data Structure and Implementation
- map set multimap multiset 对键值快速查找 插入 删除 O(logN)
- 最简单的分类器(nearest neighbor )
- qsort排序文件名
- Who's Aunt Zhang(hdu4633,polay定理)
- CRM上线之路 走上了CRM实施顾问-第16天上班 -第四周
- HDU 1879 继续畅通工程 最小生成树之处理已建的边
- Json转换利器Gson之实例一-简单对象转化和带泛型的List转化
- Unity 3D Physics – Rigidbody 刚体
- CMD 命令集合
- JavaScript DOM加强(佟刚)
- 七个高效的文本编辑习惯(以Vim为例)
- 北京实习的收获之我眼中的程序员