poj 2409 polya定理
来源:互联网 发布:那些软件培训机构好吗 编辑:程序博客网 时间:2024/05/17 05:59
#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>using namespace std;typedef long long LL;int gcd(int x,int y){ return y ? gcd(y,x%y) : x;}int main(){ int n,m; LL ans; while(scanf("%d%d",&m,&n) != EOF){ if(m==0 && n == 0) break; ///翻转 if(n & 1){ ans = pow(m ,n/2+1) * n; } else{ ans = pow(m ,n/2+1)* (n/2) + pow(m,n/2) * (n/2); } ///旋转 for(int i = 1; i <= n; i++){ ans += pow(m,gcd(n,i)); } printf("%lld\n",ans/(n*2)); } return 0;}
我等弱菜,我真的是很难看懂polya定理啊卧槽。。。看不懂啊看不懂啊
还是不看好吧啦 orz... 数学什么的,给跪了!
0 0
- POJ 2409 Polya定理
- poj 2409 polya定理
- poj 2409 polya定理
- poj 2409 polya定理
- poj-1286&&2409-polya定理
- poj 2409(polya定理模板)
- POJ 1286 && POJ 2409 Polya定理
- POJ 2409 Let it Bead Polya定理
- poj-2409(polya定理模板)
- POJ 2409 - Let it Bead【Polya定理】
- poj 2409 Let it Bead Polya定理
- poj 1286 polya定理
- poj 1286 poj 2409 hdu 1812 polya定理 组合数学
- poj 2154 polya定理+优化
- poj 2409 Let it Bead(polya定理)
- POJ 2409 Let it Bead polya 定理 和 置换
- 【裸polya定理】poj 2409 Let it Bead
- poj 2409 Let it Bead Polya波利亚定理
- SSH整合配置
- Android布局篇
- UVa:846 - Steps
- Direct3D-四大变换
- B/S困惑讲解(C/S XML HTML javascript jquery ajax)
- poj 2409 polya定理
- 操作系统利用管道通信来批量判断程序结果的正确与否
- 面试题4 替换空格
- Android 系统启动
- 杭电2058
- 双绞线与串扰
- 解剖Nginx·模块开发篇(6)配置文件config入门
- HDU 2236 无题II(二分图匹配+二分)
- HTML——UL+CSS布局