[Bzoj 1027] [JSOI2007] Alloy (analytic geometry + minimum ring)

Source: Internet
Author: User

Title: http://www.lydsy.com:808/JudgeOnline/problem.php?id=1027

Analysis:

First of all because of an alloy and 1, so consider whether 2 material alloy can synthesize a demand alloy, as long as the first two values can be considered.

If we put these two values in a planar Cartesian coordinate system, set two material alloy coordinates (x, y) and (m,n), then the two material alloy can be synthesized by the demand alloy corresponding to the point at (x, y) (M,n) two points between the segment. (The nature of high school math vectors can be proven)

Then the problem is converted to: The plane has m material alloy point, N demand alloy point, requires the selection of the minimum material alloy point, so that these points can be all n demand alloy points all around.

The processing methods are:

Enumerate each of the two material alloy points p,q, judging whether all n demand alloy points are on the left side of the tangential segment PQ, if yes, then g[p][q]=1, otherwise g[p][q]=0. The advantage of this is that if there is a ring in Figure g, then the n points are in the ring, and the point on the ring (i.e. the material alloy point) is a combination of the alloy points of the material that satisfies. Since the material has the least alloy point, it is equivalent to finding the smallest ring in the G graph. Then the problem is solved.

[Bzoj 1027] [JSOI2007] Alloy (analytic geometry + minimum ring)

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.