Let it Bead
大意:给你m种颜色,n个珠子串起来,旋转跟反转相同算相同,问有多少种不同的涂色组合方式。
思路:Polya的简单应用。
/*************************************************************************
> File Name: POJ2409.c...
分类:
其他好文 时间:
2014-07-30 01:02:52
阅读次数:
188
Let it Bead大意:给你m种颜色,n个珠子串起来,旋转跟反转相同算相同,问有多少种不同的涂色组合方式。思路:Polya的简单应用。 1 /************************************************************************* 2 ....
分类:
其他好文 时间:
2014-07-30 00:53:22
阅读次数:
195
Necklace of Beads大意:3种颜色的珠子,n个串在一起,旋转变换跟反转变换如果相同就算是同一种,问会有多少种不同的组合。思路:正规学Polya的第一道题,在楠神的带领下,理解的还算挺快的,代码没什么好说的,裸的Polya,也不需要优化。 1 /*********************...
分类:
其他好文 时间:
2014-07-30 00:49:22
阅读次数:
220
Polya定理是个很神奇的东西~
题目大意:
n个珠子串成一个圆,用三种颜色去涂色。问一共有多少种不同的涂色方法。
不同的涂色方法被定义为:如果这种涂色情况翻转,旋转不与其他情况相同就为不同。
解题思路:
Polya定理模版题。
对于顺时针长度为i的旋转,为pow(3,__gcd(n,i);
对于翻转,当为奇数时,有:n*pow(3.0,n/2+1);
当为...
分类:
其他好文 时间:
2014-07-26 02:31:26
阅读次数:
201
Invoker
Problem Description
On of Vance's favourite hero is Invoker, Kael. As many people knows Kael can control the elements and combine them to invoke a powerful skill. Vance like Kael v...
分类:
其他好文 时间:
2014-07-26 02:16:36
阅读次数:
312
Let it Bead
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 4434
Accepted: 2916
Description
"Let it Bead" company is located upstairs at 700 Cannery Row ...
分类:
其他好文 时间:
2014-07-25 11:05:42
阅读次数:
315
Necklace of Beads
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 6547
Accepted: 2734
Description
Beads of red, blue or green colors are connected togeth...
分类:
其他好文 时间:
2014-07-25 11:04:01
阅读次数:
260
旋转可以分为n种置换,对应的不同等价类分别是gcd(n,i)个i=0时不动,有n个
翻转分为奇偶讨论,奇数时有n种置换,每种有n/2+1个
偶数时有n种置换,一半是n/2+1个,一半是n/2个
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long ll;...
分类:
其他好文 时间:
2014-07-08 19:05:15
阅读次数:
163
哈哈哈,简单polya,公式自己推导。
不过这题需要用到大数,很久没写Java,调了好久。
import java.math.*;
import java.util.*;
import java.io.*;
public class Main{
public static void main(String args[]){
Scanner cin=new Scanner(Syst...
分类:
其他好文 时间:
2014-07-08 14:45:59
阅读次数:
240
This question is not so difficult.
First,my thoughts were we should use a lot of code to find out the loop block,but there is no need to do that .
you just need to get every new position of char in ...
分类:
其他好文 时间:
2014-06-27 23:39:44
阅读次数:
293