QOJ.ac

QOJ

總分: 100 僅輸出

#16696. 地雷

统计

Heino 绘制了一个 $H \times W$ 的网格。每个格子要么是空的,要么包含一颗地雷。Heino 的好朋友 Indrek 绘制了另一个 $H \times W$ 的网格。在他的网格的每个格子中,他写下了 Heino 的网格中对应格子及其所有相邻格子(如果两个格子共享一个公共点,则它们是相邻的)中的地雷总数。然后 Indrek 擦掉了 Heino 的网格。给定 Indrek 的网格,你的任务是帮助 Heino 恢复他原来的网格。

你可以假设至少存在一个解。

输入格式

输入第一行包含两个整数:$H$($1 \le H \le 600$),表示网格的高度,以及 $W$($1 \le W \le 600$),表示网格的宽度。

接下来的 $H$ 行,每行包含 $W$ 个数字,描述 Indrek 的网格。

输出格式

输出应包含 $H$ 行。每行应包含 $W$ 个字符:X 表示地雷,. 表示空格子。

如果存在多个正确解,提交其中任意一个即可。

样例

输入样例 1

3 5
24531
46631
34310

输出样例 1

.XXX.
.XX..
XX...

子任务

在本题中,你将获得 10 个输入文件,分别命名为 mines.01.in ... mines.10.in。作为解决方案,你需要提交对应的输出文件。你不需要提交程序。


或者逐个上传:

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.