编程介的小学生 2019-06-27 13:27 采纳率: 20.5%
浏览 273

在网格之中涂色的一个题目,怎么采用C语言的程序的编写的技术的代码的实现的方式是什么

Problem Description
Brute force may refer to any of several problem-solving methods involving the evaluation of multiple (or every) possible answer(s) for fitness. There is a very familiar brute-force problem for you.
There is an N * M grid, some are black while some are white. As iSea loves white more than black, he tries to change the color of all grids into white. Each time, he can choose one grid, and then the grid and its four adjacent grids will flip its color, that is, white to black, or black to white.
To make things worse, some grids are broken, and iSea can't change color on this grid, but he can change its color with its unbroken adjacent grids. Is this task possible for him?

Input
The first line contains a single integer T, indicating the number of test cases.
Each test case includes three integers N, M, K, K means the number of broken grids. Then N lines following, each line contains a string only contains 'B' or 'W', 'B' indicates black grid, 'W' indicates white grid.
Then K lines following, each line contains two integers Xi, Yi (1-based), means grid (Xi, Yi) is broken.

Technical Specification
1. 1 <= T <= 64
2. 1 <= N, M, K <= 256
3. 1 <= Xi <= N, 1 <= Yi <= M, no grid appears more than once.

Output
For each test case, output the case number first, if possible, output "Yes", otherwise output "No" (without quote).

Sample Input
3
2 2 0
BW
BB
2 2 1
BW
BW
2 1
4 3 2
WBW
BBB
WBW
WWW
2 2
3 2

Sample Output
Case 1: Yes
Case 2: Yes
Case 3: No

  • 写回答

1条回答 默认 最新

  • 电板路设计小白 2019-08-28 09:30
    关注

    libwindow软件是用C语言进行开发的,然后里面有库函数可以实现对网格的颜色填充

    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)