HDU4633 Who's Aunt Zhang

来源:互联网 发布:python heatmap 编辑:程序博客网 时间:2024/05/22 13:24

根据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


怒贴代码!

#include <cstdio>#include <cstring>#include <cctype>#include <cstdlib>#include <ctime>#include <climits>#include <cmath>#include <iostream>#include <string>#include <vector>#include <set>#include <map>#include <list>#include <queue>#include <stack>#include <deque>#include <algorithm>using namespace std;typedef long long ll;const int mod = 10007;int T,cas=1,n,ans;int pow_mod(int x, int y){    int ret = 1;    while (y)    {        if (y&1) ret=(ret*x)%mod;        x=(x*x)%mod;        y>>=1;    }    return ret;}int main(){    scanf("%d",&T);    while (T--)    {        scanf("%d",&n);        ans=(pow_mod(n,74)+pow_mod(n,20)*6+pow_mod(n,38)*9+pow_mod(n,26)*8)%mod;        ans=(ans*pow_mod(24,mod-2))%mod;        printf("Case %d: %d\n",cas++,ans);    }return 0;}