【USACO2021 Walking Home 】题解
题目 Bessie the cow is trying to walk from her favorite pasture back to her barn. The pasture and fa ...
题目 Bessie the cow is trying to walk from her favorite pasture back to her barn. The pasture and fa ...
组合数学的推式子题公式基本上都有了 \[\Large\sum_{i=0}^nC_n^i=2^n \] \[\Large\sum_{i=0}^nC_n^i(-1)^i=0 \] ...
题目链接 首先dp得从低位向高位枚举,因为高位无论如果使用 \(2^{a_i}\) 都对低位二进制1的个数无影响,满足dp的无后效性。 设 \(dp(k, i, x, y)\) 为 \(S\) 从 ...