CF1391B Fix You
题目描述
给你一个 $n \times m$ 的矩阵,每一格上有个一标记不是 $R$ 就是 $D$,如果为 $R$ 表示这一格的物品会被送到这一格紧邻的右边的那一格,如果为 $D$ 表示这一格的物品会被送到这一格紧邻的下边的那一格。问你最少修改($R$ 变 $D$ 或者 $D$ 变 $R$)多少次使得不管哪一个里的物品最后都能到达 $(n,m)$。
translated by [yu__xuan](https://www.luogu.com.cn/user/142110)
输入格式
无
输出格式
无
说明/提示
In the first case, just changing the direction of $ (2,3) $ to D is enough.
You can verify that the resulting belt is functional. For example, if we place any luggage at $ (2,2) $ , it first moves to $ (3,2) $ and then to $ (3,3) $ .
In the second case, we have no option but to change the first $ 3 $ cells from D to R making the grid equal to RRRC.