Necklace of Beads POJ - 1286】的更多相关文章

\(\color{#0066ff}{ 题目描述 }\) 一个圈上有n个珠子,有三种颜色可以染,问本质不同的方案数(通过旋转和翻转重合的算一种) \(\color{#0066ff}{输入格式}\) 多组数据,每次一个n,以-1结束 \(\color{#0066ff}{输出格式}\) 每组数据输出一行一个数表示方案数 \(\color{#0066ff}{输入样例}\) 4 5 -1 \(\color{#0066ff}{输出样例}\) 21 39 \(\color{#0066ff}{数据范围与提示}\…
链接:http://poj.org/problem?id=1286 http://poj.org/problem?id=2409 #include <cstdio> #include <iostream> #include <cstring> #include <cmath> #include <algorithm> using namespace std; typedef long long LL; LL P_M( LL a, LL b ) {…
Necklace of Beads Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7763   Accepted: 3247 Description Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are pro…
Necklace of Beads Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7874   Accepted: 3290 Description Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are pro…
http://poj.org/problem?id=1286 题意:有红.绿.蓝三种颜色的n个珠子.要把它们构成一个项链,问有多少种不同的方法.旋转和翻转后同样的属于同一种方法. polya计数. 搜了一篇论文Pólya原理及其应用看了看polya究竟是什么东东.它主要计算所有互异的组合的个数.对置换群还是似懂略懂.用polya定理解决这个问题的关键是找出置换群的个数及哪些置换群,每种置换的循环节数.像这样的不同颜色的珠子构成项链的问题能够把N个珠子看成正N边形. Polya定理:(1)设G是p…
Necklace of Beads 大意:3种颜色的珠子,n个串在一起,旋转变换跟反转变换假设同样就算是同一种,问会有多少种不同的组合. 思路:正规学Polya的第一道题,在楠神的带领下,理解的还算挺快的.代码没什么好说的,裸的Polya.也不须要优化. /************************************************************************* > File Name: POJ1286.cpp > Author: GLSilence &…
Necklace of Beads Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7451   Accepted: 3102 Description Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are pro…
Necklace of Beads Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 630    Accepted Submission(s): 232 Problem Description Beads of red, blue or green colors are connected together into a circular…
Necklace of Beads Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9162   Accepted: 3786 Description Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are pro…
Necklace of Beads Description Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 24 ). If the repetitions that are produced by rotation around the center of the circular necklace or reflection to the a…