摘要:
一道很好的题、 我们发现数据范围很GG 大概log n能过 然后考虑以下关于log的算法,再选几个小数据手玩一下 可以发现: 我们将k按二进制位考虑: 对于k的每一位, 如果为0, 那么每个and的两个数的二进制最后一位位一定不能均为1, 由此得出转移方程:f [ i ] [ 0 ] = f [ i 阅读全文
摘要:
递推式:f [ n ] =8 f [ n - 1] + 3f [ n - 2 ] + f [ n - 3 ] 由:f [ n - 1] + f [ n - 2 ] + f [ n - 3 ] 需要得到: f [ n ] + f [ n ] + f [ n ] 根据矩乘原理(怎么乘的)构造转移矩阵: 阅读全文