uva 10733 - The Colored Cubes(置换)
来源:互联网 发布:mac 下载不在dock 编辑:程序博客网 时间:2024/05/18 01:32
题目链接:uva 10733 - The Colored Cubes
题目大意:给定n,表示有n种颜色,为立方体上色,相同旋转视为一种。
解题思路:参考uva 10601 - Cubes,正方体的旋转都是一样的,只要由考虑边的颜色变成考虑面的颜色。
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef long long ll;ll n;ll solve (int k) { ll ret = 1; for (int i = 0; i < k; i++) ret *= n; return ret;}ll still () { return solve(6);}ll rot_point () { return 2 * 4 * solve(2);}ll rot_edge () { return 6 * solve(3);}ll rot_plane () { return 3 * 2 * solve(3) + 3 * solve(4);}ll polya () { return still() + rot_point() + rot_edge() + rot_plane();;}int main () { while (scanf("%lld", &n) == 1 && n) { printf("%lld\n", polya() / 24); } return 0;}
0 0
- uva 10733 - The Colored Cubes(置换)
- UVA - 10733 The Colored Cubes (置换)
- UVA 10733 - The Colored Cubes(Ploya)
- UVA 10733 - The Colored Cubes【Polya定理】
- uva 1352 - Colored Cubes
- 【uva】1352-Colored Cubes
- UVa-3401 Colored Cubes
- HOJ The Colored Cubes
- uva 10601 - Cubes(置换)
- uva 1352 - Colored Cubes(枚举)
- uva 1352 Colored Cubes(枚举)
- UVA 1352 Colored Cubes(回溯)
- uva 1352 - Colored Cubes(枚举)
- UVA 1352 Colored Cubes(暴力搜索枚举)
- Hoj 2084 The Colored Cubes (polya计数)
- Colored Cubes
- Colored Cubes
- Colored Cubes
- object-c 学习总结2
- 黑马程序员---了解开发工具及内部类
- [leetcode] Reorder List
- Android开发工具ADT关联源码与API文档
- go, Getting Started, Hello world
- uva 10733 - The Colored Cubes(置换)
- Fermat’s Chirstmas Theorem
- 对比使用C# unsafe代码和OpenCV进行图像处理的效率(上)
- poj 2442 Sequence stl'练习
- git学习 - fork项目,追踪项目,合并代码
- Jump Game 动态规划
- JAVA abstract class和interface 区别
- Ural 1613 For Fans of Statistics
- Android 通过Drawable资源自定义编辑框