HDU 5868 Different Circle Permutation(burnside 引理) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5868 Description You may not know this but it's a fact that Xinghai Square is Asia's largest city square. It is located in Dalian and, of course, a landm…
似乎是比较基础的一道用到polya定理的题,为了这道题扣了半天组合数学和数论. 等价的题意:可以当成是给正n边形的顶点染色,旋转同构,两种颜色,假设是红蓝,相邻顶点不能同时为蓝. 大概思路:在不考虑旋转同构的情况下,正n边形有fib(n+1)+fib(n-1)种染色方法(n==1特判),然后后面就是套公式了,涉及到要用欧拉定理优化,不然会T.(理论的东西看下组合数学书中polya计数部分,及数论书中欧拉函数部分中 n的约数的欧拉函数,感觉看博客不如系统的看看书,再结合一下网上一些比较基础的pol…
公式,矩阵快速幂,欧拉函数,乘法逆元. $an{s_n} = \frac{1}{n}\sum\limits_{d|n} {\left[ {phi(\frac{n}{d})×\left( {fib(d - 1) + fib(d + 1)} \right)} \right]}$. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #in…
题面 先往上套Burnside引理 既然要求没有$\frac{2*π}{n}$的角,也就是说两个人不能挨着,那么相当于给一个环黑白染色,两个相邻的点不能染白色,同时求方案数.考虑$n$个置换子群,即向一边旋转i(1<=i<=n)个单位,那么每个置换子群下循环节的长度是$lcm(i,n)/i$,那循环节数目就是$n/(lcm(i,n)/i)=gcd(i,n)$,然后式子就出来了,设$p(i)$是给长度为$i$的环染色的方案 $ans=\frac{\sum\limits_{i=1}^np(gcd(…
题意:有N个座位,人可以选座位,但选的座位不能相邻,且旋转不同构的坐法有几种.如4个座位有3种做法.\( 1≤N≤1000000000 (10^9) \). 题解:首先考虑座位不相邻的选法问题,如果不考虑同构,可以发现其种数是一类斐波那契函数,只不过fib(1)是1 fib(2)是3. 由于n很大,所以使用矩阵快速幂来求fib. 再者考虑到旋转同构问题,枚举旋转i (2π/n) 度,其等价类即\( gcd(i, n) \)种,那么可以得\[S(n)=\frac{1}{n}\sum_{d|n}^{…
Necklace of Beads Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1817 Description Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 40 ). If…
Different Circle Permutation Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 218    Accepted Submission(s): 106 Problem Description You may not know this but it's a fact that Xinghai Square is…
Birthday Toy Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 644    Accepted Submission(s): 326 Problem Description AekdyCoin loves toys. It is AekdyCoin’s Birthday today and he gets a special “…
Different Circle Permutation Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 208    Accepted Submission(s): 101 Problem Description You may not know this but it's a fact that Xinghai Square is…
Who's Aunt Zhang Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19    Accepted Submission(s): 16 Problem Description Aunt Zhang, well known as 张阿姨, is a fan of Rubik’s cube. One day she buys a…