zoj1873 Let it Bead】的更多相关文章

思路:polya裸题,如果是旋转,对于旋转i格的循环节长度len=lcm(i,n)/i,个数就是n/len=gcd(i,n):如果是翻转,奇数个点对称轴就是一个点一条边,那么循环节个数即n/2+1, 偶数个点有n/2条对称轴穿过两个点,循环节个数是n/2+1,n/2条对称轴穿过两条边,循环节个数就是n/2,然后直接套polya公式即可. #include<iostream> #include<cstdio> #include<cstring> #include<a…
描述 "Let it Bead" company is located upstairs at 700 Cannery Row in Monterey, CA. As you can deduce from the company name, their business is beads. Their PR department found out that customers are interested in buying colored bracelets. However,…
  Description Cannery Row percent of the target audience insists that the bracelets be unique. (Just imagine what happened if two women showed up at the same party wearing identical bracelets!) It's a good thing that bracelets can have different leng…
                                                                  Let it Bead Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5397   Accepted: 3609 Description "Let it Bead" company is located upstairs at 700 Cannery Row in Monterey…
Description There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., N. Your task is to find the bead whose weight is median (the ((N+1)/2)th among all beads). The foll…
题目传送:http://poj.org/problem?id=2409 Description "Let it Bead" company is located upstairs at 700 Cannery Row in Monterey, CA. As you can deduce from the company name, their business is beads. Their PR department found out that customers are inte…
[POJ2409]Let it Bead 题意:用$m$种颜色去染$n$个点的环,如果两个环在旋转或翻转后是相同的,则称这两个环是同构的.求不同构的环的个数. $n,m$很小就是了. 题解:在旋转$i$次后,循环节的个数显然是$gcd(i,n)$. 如果考虑翻转,我们将点从$0$到$n-1$标号,令其先以0到圆心的连线为对称轴翻转,再旋转i次,则原来编号为x的会变成$n-x+i \mathrm{mod} n$,令$n-x+i=x \mathrm{mod} n$,则$2x=i$或$2x=n+i$.…
Median Weight Bead Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3162 Accepted: 1630 Description There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, -, N.…
描述 There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., N. Your task is to find the bead whose weight is median (the ((N+1)/2)th among all beads). The following com…
Description There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., N. Your task is to find the bead whose weight is median (the ((N+1)/2)th among all beads). The foll…