CF948A Protect Sheep
题目描述
## 题目背景:(有少许简化和修改,但依然符合题意)
Bob是个农夫,他有一个$R*C$ 的草地。
草地上有许多羊,同时也有许多狼。
羊不会动,但是狼会向上下左右四个方向动。
所以Bob打算在草地上放上狗,使狼和羊完全隔开。
你的任务就是输出一种可行方案,
放的狗的数量不必最少。
输入格式
第一行两个数$R$ $(1
输出格式
第一行输出$Yes$或$No$,表示是否可行。
如果可行$Yes$
接下来输出$R$行,每行一个长度为$C$的字符串。
来表示放完狗之后的情况。
狗只能放到空地上,用'D'表示。
感谢@cn:苏卿念 提供的翻译
说明/提示
In the first example, we can split the pasture into two halves, one containing wolves and one containing sheep. Note that the sheep at (2,1) is safe, as wolves cannot move diagonally.
In the second example, there are no empty spots to put dogs that would guard the lone sheep.
In the third example, there are no wolves, so the task is very easy. We put a dog in the center to observe the peacefulness of the meadow, but the solution would be correct even without him.