题意
(2 imes M)方格,每个方格涂红、绿、蓝三色,要满足
(1)总共(R)个红色,(G)个绿色,(B)个蓝色
(2)相邻格子颜色不同
(4)每个(2 imes 2)的块要包含所有颜色
做法
单独考虑一列,称这个的颜色为这列未出现过的颜色
对于确定好的(M)列颜色,方案数显然为(2)
那么问题被我们转化为(M)列的颜色
显然,有(r=M-R)列红色,(g=M-G)列绿色,(b=M-B)列蓝色
一般地,钦定红色为第一列的颜色,分别考虑最后一列是否为红色,则可确定红色将整个序列分成了(g=r~or~r-1)段
枚举偶数段的个数(e),则奇数段个数为(g-e)
然后组合数乱搞