UVa 10279

From Algorithmist
Jump to: navigation, search

10279 - Mine Sweeper[edit]

Summary[edit]

Simulate the state of a mine sweeper game given the revealed positions of the map.

Explanation[edit]

  • Look at the explanation for this problem UVa_10189.
  • We need to keep track of whether a mine is revealed or not so we can decide to display them all later.
  • We also need to keep track of which cells we used.

Gotchas[edit]

  • Dont forget the blank line after each output.


Input[edit]

2

8
...**..*
......*.
....*...
........
........
.....*..
...**.*.
.....*..
xxx.....
xxxx....
xxxx....
xxxxx...
xxxxx...
xxxxx...
xxx.....
xxxxx...
4
...*
..*.
....
....
xxx.
xxxx
xxxx
x...

Output[edit]

001.....
0013....
0001....
00011...
00001...
00123...
001.....
00123...

012*
01*2
0111
0...