AOJ 2164 Revenge of the Round Table 题解《挑战程序设计竞赛》

AOJ 2164 Revenge of the Round Table 题解《挑战程序设计竞赛》
AOJ 2164 Revenge of the Round Table 圆桌基情:有男女共n人入座一个圆桌,若连续k个以上同性坐在一起就会搞基。求不搞基的坐法种数?4.1更加复杂的数学问题 计数 大的思路还是Burnside引理,难点在于怎么计算染色种数。在循环节长度i和k固定的时候,循环节的个数应该是gcd(i,n)。下面考虑循环节个数为i时的方案数dp[i]。记男为A,女为B,定义:dp_a[MAX_N][MAX_N],    &nb...

继续阅读码农场 » AOJ 2164 Revenge of the Round Table 题解《挑战程序设计竞赛》

原文链接http://www.hankcs.com/program/algorithm/aoj-2164-revenge-of-the-round-table.html

转载于:https://my.oschina.net/hankcs/blog/508567

猜你喜欢

转载自blog.csdn.net/weixin_34080903/article/details/91780102
今日推荐