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;
}


posted @ 2017-08-15 08:13  yxysuanfa  阅读(216)  评论(0编辑  收藏  举报