UVA 10733 - The Colored Cubes(Ploya)

UVA 10733 - The Colored Cubes

题目链接

题意:一个立方体。n种颜色,问能涂成多少不同立方体

思路:Ploya求解,正方体相应24种不同旋转一一计算出循环个数就可以。和 UVA 10601 - Cubes这题类似

代码:

#include <stdio.h>
#include <string.h>

unsigned long long n;

int main() {
	while (~scanf("%llu", &n) && n) {
		printf("%llu\n", (n * n * n * n * n * n + 12 * n * n * n + 3 * n * n * n * n + 8 * n * n) / 24);
 	}
	return 0;
}
时间: 2024-08-24 13:59:59

UVA 10733 - The Colored Cubes(Ploya)的相关文章

UVA - 10733 The Colored Cubes (置换)

All 6 sides of a cube are to becoated with paint. Each side is is coated uniformly with one color. When a selectionof n different colors of paint is available, how many different cubes can youmake? Note that any two cubes are onlyto be called "differ

uva 1352 Colored Cubes(枚举)

uva 1352 Colored Cubes There are several colored cubes. All of them are of the same size but they may be colored differently. Each face of these cubes has a single color. Colors of distinct faces of a cube may or may not be the same. Two cubes are sa

POJ2741 Colored Cubes

Description There are several colored cubes. All of them are of the same size but they may be colored differently. Each face of these cubes has a single color. Colors of distinct faces of a cube may or may not be the same. Two cubes are said to be id

10601 - Cubes(Ploya)

UVA 10601 - Cubes 题目链接 题意:给定正方体12条棱的颜色,要求用这些棱能组成多少不同的正方体 思路:利用ploya定理去求解,分类讨论,正方体一共24种旋转.相应的旋转方式有4种: 1.不动 2.沿两面中点连线旋转 3.沿对顶点连线旋转 4.沿两棱中点连线旋转 简单推算出每种情况相应的循环组数.在加上组合数学去进行选择颜色求解.注意第4种情况中,有两条棱和其它的循环长度是不同的,能够枚举然后扣掉讨论. 代码: #include <stdio.h> #include <

UVa 10051 Tower of Cubes(DP 最长立体堆叠)

 题意  给你n个立方体  立方体每面都涂有颜色  当一个立方体序号小于另一个立方体且这个立方体底面的颜色等于另一个立方体顶面的颜色  这个立方体就可以放在另一个立方体上面  求这些立方体堆起来的最大高度: 每个立方体有6种放置方式  为了便于控制  个人喜欢将一个立方体分解为6个  这样每个立方体只用考虑顶面和底面   d[i]表示分解后以第i个立方体为基底可以达到的最大高度  j从1到i-1枚举  当满足top[i]==bot[j]时  d[i]=max(d[i],d[j]+1) #in

UVa 10051 Tower of Cubes(DP 最长序列)

Problem A: Tower of Cubes  In this problem you are given N colorful cubes each having a distinct weight. Each face of a cube is colored with one color. Your job is to build a tower using the cubes you have subject to the following restrictions: Never

UVa 10051 - Tower of Cubes

题目:给你n个正方体,每个面有一种颜色,他们按照重量递增的方式排列着,现在要求把他们排成一个塔, 每层一个正方体,要求每个正方体上面的正方体的重量全都小于他,还要保证接触的面上的颜色相同, 问最高能摆放多少层,答案不唯一. 分析:dp,动态规划,lis.最大不下降子序列,已经排好序,满足接触的面颜色相同即可. 定义状态:f(i,k)为以第i个方块作为顶时,k面朝上时的最大高度: 转移方程:f(i,k)= max(f(j,f))  { j < i,且相接处的面相同 }: 每个方块有6中摆放法式,利

UVaLive 3401 Colored Cubes (暴力)

题意:给定n个立方体,让你重新涂尽量少的面,使得所有立方体都相同. 析:暴力求出每一种姿态,然后枚举每一种立方体的姿态,求出最少值. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostrea

UVALIVE 3401 Colored Cubes

翻转立方体 #include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <stack> #include <queue> #include <cctype> #include <cstdio> #include <string>