[ARC203C] Destruction of Walls 题解

· · 题解

Upd on 8.11:将 H, Wn, m 统一为了 H, W

看到 \bf 0 \le K \le H + W 就显然分讨了。

\binom{H + W - 2}{H - 1} \cdot \binom{2(H - 1)(W - 1)}{2} - \binom{H + W - 4}{H - 2} \cdot (H + W - 3) + \binom{H + W - 2}{H + 1} \cdot (H - 1) + \binom{H + W - 2}{W + 1} \cdot (W - 1)

代码是好写的,所以这里就不放了。