CF445A DZY Loves Chessboard
题目描述
一个棋盘上有一些格子是坏的,另一些是正常的。对于每一个正常的格子,都要在上面放上棋子。
请找到一组解使没有两个相同颜色的棋子相邻(两个格子相邻为它们存在共同的边)
输入格式
第一行为两个数n,m。(1
输出格式
输出n行,每行m个字符。第i个字符串的第j个字符应为“W”,“B”或“ - ”。字符“W”是指在格子上放白色的棋子,“B”意味着放黑色的棋子,“ - ”表示坏掉的格子。
如果有多组答案,输出其中的一个
感谢@zhaotiensn 提供的翻译
说明/提示
In the first sample, DZY puts a single black chessman. Of course putting a white one is also OK.
In the second sample, all $ 4 $ cells are good. No two same chessmen share an edge in the sample output.
In the third sample, no good cells are adjacent. So you can just put $ 3 $ chessmen, no matter what their colors are.