UVa 11044 searching for Nessy (water ver.)

Source: Internet
Author: User
Tags time limit

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.