Minelayer
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a list of mines, you need to create a Minesweeper game board.
Input
The numbers and (both integers, positive, not exceeding ) represent the number of rows and columns on the board respectively. Next, the number (an integer, non-negative, not more than ) represents the number of mines on the board. Following this, there are pairs of numbers, which are the coordinates of the mines on the board (the first number is the row, the second number is the column).
Output
You need to display the board on the screen, using the following format: if a given cell is a mine, display an asterisk *
, otherwise display the number of mines in the neighboring cells (vertically, horizontally and diagonally).
Examples
Input #1
Answer #1
Submissions 5K
Acceptance rate 44%