2013 Multi-University Training Contest 4 Who's Aunt Zhang
看题就知道要用polya,但是当时没做出来,还是不是很熟悉polya!!!
总共有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<stdio.h>
int pows(int a,int b)
{
int ans=;
while(b){
if(b&) ans=(ans*a)%;
b>>=;
a=(a*a)%;
}
return ans%;
}
int main(){
int n,t,k=,sum;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
sum=(pows(n,)+pows(n,)*+pows(n,)*+pows(n,)*)%;
sum=(sum*pows(,-))%;
printf("Case %d: %d\n",++k,sum);
}
return ;
}
2013 Multi-University Training Contest 4 Who's Aunt Zhang的更多相关文章
- Integer Partition(hdu4658)2013 Multi-University Training Contest 6 整数拆分二
Integer Partition Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...
- Partition(hdu4651)2013 Multi-University Training Contest 5
Partition Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Sub ...
- ACM ICPC Central Europe Regional Contest 2013 Jagiellonian University Kraków
ACM ICPC Central Europe Regional Contest 2013 Jagiellonian University Kraków Problem A: Rubik’s Rect ...
- Partition(hdu4651)2013 Multi-University Training Contest 5----(整数拆分一)
Partition Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Sub ...
- JSU 2013 Summer Individual Ranking Contest - 5
JSU 2013 Summer Individual Ranking Contest - 5 密码:本套题选题权归JSU所有,需要密码请联系(http://blog.csdn.net/yew1eb). ...
- HDU4888 Redraw Beautiful Drawings(2014 Multi-University Training Contest 3)
Redraw Beautiful Drawings Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Jav ...
- HDU 2018 Multi-University Training Contest 3 Problem A. Ascending Rating 【单调队列优化】
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6319 Problem A. Ascending Rating Time Limit: 10000/500 ...
- 2015 Multi-University Training Contest 8 hdu 5390 tree
tree Time Limit: 8000ms Memory Limit: 262144KB This problem will be judged on HDU. Original ID: 5390 ...
- hdu 4946 2014 Multi-University Training Contest 8
Area of Mushroom Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
随机推荐
- 第二十九篇、UICollectionView瀑布流
1.实现思路 >第一种方案:UIScrollView 镶嵌三个UITableView (不推荐使用) >第二种方案:UIScrollView 镶嵌UIImageView (需要解决循环利用 ...
- 第六篇、AVplayer定制视频播放控件
1.引用头文件#import AVFoundation 2.自定义AVPlayer(播放的机器) 3.自定义AVPlayerItem(胶片) >> 视频的URL转成AVAsset 4.AV ...
- 第二十九篇、CoreAnimation的使用
使用的的三个步骤 1.初始化演员 2.设置好剧情 3.播放 主要类: CALayer // 绘图部分 CABaseAnimation // 基本动画(缩放,移动) CAKeyframeAnimatio ...
- Swift协议(Protocol)
协议是为方法.属性等定义一套规范,没有具体的实现. 协议能够被类.结构体等具体实现(或遵守). protocol SomeProtocol { // protocoldefinition goes h ...
- 【转】Newtonsoft.Json 的序列化与反序列化
http://www.cnblogs.com/08shiyan/p/3464028.html 首先补充一点,Json.Net是支持序列化和反序列化DataTable,DataSet,Entity Fr ...
- Today’s words
transcendental,transcendental capacity commission,the commission would keep venetian unimodel transi ...
- js分割文件快速上传
<?php header('Content-type:text/html;charset=UTF-8'); ?> <?php if ($_FILES) { if(!file_exis ...
- 提升PHP性能的21种方法
提升PHP性能的21种方法. 1.用单引号来包含字符串要比双引号来包含字符串更快一些.因为PHP会在双引号包围的字符串中搜寻变量,单引号则不会.2.如果能将类的方法定义成static,就尽量定义成st ...
- 1046 Shortest Distance (20)
#include<stdio.h> int main() { int n,m,a,b,tem,pre,p; int i,j; ]; while(scanf("%d",& ...
- android studio如何开启与禁用版本控制vcs
1.开启