Who's Aunt Zhang

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 125    Accepted Submission(s): 108

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
 
Recommend
zhuyuanchen520
 
 
/*
本体明显的polya的应用.     G为置换群总数,c(gi)为群gi的循环节。。
  
步骤:               

先求置换种类,接着再手动画图算出循环节!!!

本题模型共有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 <iostream>
#include<stdio.h>
#include<string.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;
const int mo=; int q(int a,int b)
{
int ans=;
a%=mo;
while(b)
{
if(b&)
{
ans=ans*a%mo;
b--;
}
b>>=;
a=a*a%mo;
}
return ans;
} int main()
{
int ca,i,j,T,k;
scanf("%d",&T);
for(ca=;ca<=T;ca++)
{
scanf("%d",&k);
int ans=;
ans+=q(k,);//不转 ans+=q(k,)*+q(k,)*;//面面90与270度;
ans+=q(k,)*;//面面180度; ans+=q(k,)*;//対棱180; ans+=q(k,)*+ q(k,)*;//对顶; ans%=mo;
ans*=q(,mo-);
ans%=mo; printf("Case %d: ",ca);
printf("%d\n",ans); } }

最新文章

  1. 使用sklearn进行集成学习——实践
  2. UVA - 11134 Fabled Rooks[贪心 问题分解]
  3. BZOJ-4300 绝世好(蛋疼)题 DP(递推)
  4. 在windows下创建一个Mongo服务
  5. 关于XML的DTD概述
  6. linux重定向总结:如何将shell命令的输出信息自动输出到文件中保存
  7. thinkphp3.23整合phpexcel
  8. Markdown简短教程
  9. Asp.net管道 (第二篇)
  10. Oracle Day09 存储与触发器
  11. ( ̄y▽ ̄)~ 智能手机II
  12. Linux系统下安装Mysql5.7.18教程收集分享
  13. Swift数组的存取与修改
  14. Markdown 练习
  15. Akka(28): Http:About Akka-Http
  16. ajax&amp;bootstrap
  17. scala的安装及使用
  18. FAT32文件系统学习(1) —— BPB的理解
  19. 极快瑞的函数式编程,Jquery涉及的一些函数
  20. users命令详解

热门文章

  1. Vue学习(二) :第一个Vue项目
  2. mysql 5.7 安装配置及无法启动的问题解决
  3. QBXT Day 5图论相关
  4. 改变主程序的入口 main
  5. 基本vim快捷键
  6. JS获取select被选中的option的值
  7. C#中winform下利用ArcEngine调用ArcGIS Server发布的服务 AE9.3
  8. python学习笔记:(二)基本数据类型
  9. struts2 2.5.16 通配符方式调用action中的方法报404
  10. 批处理文件将多台连接的手机安装同一个APP