根據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. 繞相對棱中心的軸轉
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;
}