转移矩阵怎么构造
我太菜了。
你考虑一个DP:
\[dp_1=a_{1,1}\times dp_1+a_{1,2}\times dp_2+\dots+a_{1,n}\times dp_n\\
dp_2=a_{2,1}\times dp_1+a_{2,2}\times dp_2+\dots+a_{2,n}\times dp_n\\
\dots\\
dp_n=a_{n,1}\times dp_1+a_{n,2}\times dp_2+\dots+a_{n,n}\times dp_n
\]
那么 \(a\) 就是转移矩阵。
如果有多维DP压缩为一维就可以了。

浙公网安备 33010602011771号