poj 1286 Necklace of Beads 项链旋转+对称群的polya计数
来源:互联网 发布:2017淘宝补单平台 编辑:程序博客网 时间:2024/06/01 18:37
//poj 1286//sep9#include<iostream>using namespace std;typedef __int64 INT;INT pow3[32];INT gcd(INT a,INT b){return a%b==0?b:gcd(b,a%b);}int main(){pow3[0]=1;for(INT i=1;i<24;++i)pow3[i]=pow3[i-1]*3;INT n;while(scanf("%I64d",&n)==1&&n>=0){if(n==0){printf("0\n");continue;}INT ans=n&1?n*pow3[n/2+1]:(n/2)*pow3[n/2]+(n/2)*pow3[n/2+1];for(INT i=0;i<n;++i)ans+=pow3[gcd(i,n)];printf("%I64d\n",ans/(2*n));}return 0;}
0 0
- poj 1286 Necklace of Beads 项链旋转+对称群的polya计数
- poj 1286 Necklace of Beads -----polya计数
- poj 1286 Necklace of Beads polya计数
- poj 1286 Necklace of Beads 【polya计数】
- POJ 1286-Necklace of Beads(Polya计数)
- POJ 1286-Necklace of Beads(Polya定理-旋转+翻转 串项链)
- POJ 1286 Necklace of Beads && POJ 2409 Polya计数原理
- POJ 1286 Necklace of Beads(polya计数、burnside定理)
- POJ--1286[Necklace of Beads] Polya定理
- POJ 1286 Necklace of Beads Polya定理
- poj 1286 Necklace of Beads(Polya定理)
- poj 1286 Necklace of Beads (polya)
- poj 1286 Necklace of Beads (polya)
- POJ 1286 Necklace of Beads(polya)
- POJ 1286 Necklace of Beads(Polya原理)
- POJ 1286 Necklace of Beads Polya .
- POJ 1286 Necklace of Beads (Polya)
- poj Necklace of Beads 1286 (polya定理)置换群
- 如何在Android手机上退出Google帐号
- ReactiveCocoa - iOS开发的新框架
- CentOS 6.3 下安装配置GO 1.2.1
- Unity3D之在Scene窗口显示Waypoint路径
- 软件工程
- poj 1286 Necklace of Beads 项链旋转+对称群的polya计数
- 如何查看oracle的表空间使用情况
- Mac Android Studio 远程bindSerVice之aidl
- 使用ReactiveCocoa实现iOS平台响应式编程
- servletContextListener监听器调用问题
- 加载大图片时,出现的OOM异常,以及处理OOM异常的方法
- android open gl es2.0 学习
- iOS笔记之tableView
- XStream双下划线问题解决与CDATA标记同时的方案