问题1645--GOPHER HOLE II

1645: GOPHER HOLE II

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

Be a gopher-hole player's assistant.

输入

A sequence of player's views of gopher hole games, formatted as in the output of GOPHER HOLE I. The games are not necessarily successive nor even from the same field. None of the views will be after the player picked a hole.

输出

The output will look the same as the input, except for the uncleared locations next to (horizontally, vertically, or diagonally) cleared locations. These are printed with the following notation: A '*' is printed if it can be logically concluded that a hole is at this location. A '$' is printed if it can be logically concluded that a hole is not at this location. A '?' if no deterministic conclusion can be drawn about the existence of a hole at this location.

样例输入 Copy

+----------+
|###1      |
|#311      |
|11        |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
+----------+

+----------+
|##1       |
|#21       |
|11        |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
+----------+

样例输出 Copy

Program 7 by team 0
+----------+
|*$*1      |
|*311      |
|11        |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
+----------+

+----------+
|$*1       |
|*21       |
|11        |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
+----------+
End of program 7 by team 0