#P6809. [BalticOI 2010] Mines (Day2)

    ID: 7567 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2010提交答案Special JudgeBalticOI(波罗的海)

[BalticOI 2010] Mines (Day2)

Background

This is an output-only problem. The input is public; please see the attachments of the problem.

Problem Description

You are given an H×WH \times W matrix AA. Each number in matrix AA is equal to the number of X in matrix BB at the same position plus the number of X in the eight surrounding directions of that position.

Please construct any H×WH \times W matrix BB consisting of . and X that satisfies the requirement.

Input Format

The first line contains two integers H,WH, W, indicating the size of the matrix.

The next HH lines each contain WW integers, describing matrix AA.

Output Format

Output HH lines, each containing WW characters . or X, representing a matrix BB that satisfies the condition. This problem uses SPJ.

3 5
24531
46631
34310
.XXX.
.XX..
XX...

Hint

For 100%100\% of the testdata, it is guaranteed that 1H,W6001 \le H, W \le 600, and a solution always exists.

Translated from BalticOI 2010 Day2 T3 Mines.

Translated by ChatGPT 5