vijos上的题解: 1.因为每个格子不是被覆盖就是没被覆盖,状态只有0 1两种,m<=5,所以可以将每一列的状态压缩,看作一个二进制数.2.矩阵G表示从I状态到J状态的路径条数,自乘N次为长度为N的路径条数.3.矩阵乘法可以用快速幂优化,时间复杂度为O(logN*(2^M)^3)可以接受4.用I表示前一个状态,J表示这个状态,则I可以到达J的条件是:(K = 2^M - 1 )I OR J = K 且 I AND J = AG[W]I状态未能填满的格子均由横向1*2的骨牌填充,此时J状态相应的…
题目链接: 传送门 Domino Effect time limit per test:1 second memory limit per test:256 megabytes Description Little Chris knows there's no fun in playing dominoes, he thinks it's too random and doesn't require skill. Instead, he decided to play with the…
Description Did you know that you can use domino bones for other things besides playing Dominoes? Take a number of dominoes and build a row by standing them on end with only a small distance in between. If you do it right, you can tip the first domin…