Minesweeper is a single-player computer game. The objective of the game is to clear an abstract minefield without detonating a mine. When the game is started, the player is presented with a grid of n x m blank squares. If the player clicks on a square without a mine, a digit is revealed in that square, the digit indicating the number of adjacent squares that contains mines. Two squares are adjacent if they share an edge or a corner, i.e. a square can have at most 8 adjacent squares. By using logic, players can in many instances use this information to deduce that certain other squares are mine-free (or mine-filled), and proceed to click on additional squares to clear them or
mark them with flag graphics to indicate the presence of a mine.
Clark Kent is a Minesweeper addict. And with help from his Kryptonian (a planet far far away
from earth) powers he solves them at lightning speed and gives them to you. Your job is to tell
him whether the solved version is correct or not. A board is correctly solved iff all flagged
squares should contain a mine and every square containing a number X has exactly X adjacent
squares flagged.
The first line of input will contain an integer T <= 20 denoting the number of test cases.
Each test case will be formatted as follows:-
Output one line per case:-
2 8 8 F1012210 1101FF21 121234F1 F2F11F21 12111121 1100012F F21101F2 12F10111 8 8 F1012210 1101FF21 121234F1 F2FF1F21 12111121 1100012F F21101F2 12F10111
Well done Clark! Please sweep the mine again!
Migrated from old NTUJ.
ICPC 2008, Amritapuri
No. | Testdata Range | Score |
---|