11044-searching for Nessy
Time limit:3.000 seconds
Http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=99&page=show_problem &problem=1985
the Loch Ness Monsteris a mysterious and unidentified animal said to inhabit Loch, a Ness large deep freshwater Near the city of Inverness in northern Scotland. Nessie is usually categorized as a type of the lake monster. Http://en.wikipedia.org/wiki/Loch_Ness_Monster
In July 2003, the BBC reported a extensive investigation to Loch Ness by a BBC team, using separate sonar, beams D No trace of Any¨sea Monster¨ (i.e., any large animal, known or unknown) in the loch. The BBC team concluded this Nessie does not exist. Now we are want to repeat the experiment.
Given a grid of n rows and m columns representing the loch, 6n, m100 Find the minimum number s of sonar beams your must put in the square such so we can control every position I n the grid, with the following conditions:
One sonar occupies one position in the grid; The sonar beam controls its own cell and the contiguous cells;
The border cells do isn't need to being controlled, because nessy the cannot hide there (she is too big).
For example,
Where X represents a sonar, and the shaded cells are controlled by their sonar; The last figure gives us a solution.