标签:style blog http color os art
题意:一个立方体,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;
}UVA 10733 - The Colored Cubes(Ploya),布布扣,bubuko.com
UVA 10733 - The Colored Cubes(Ploya)
标签:style blog http color os art
原文地址:http://blog.csdn.net/accelerator_/article/details/37959505