hdu6206 Apple ACM/ICPC Asia Regional Qingdao Online

Source: Internet
Author: User

Address: http://acm.split.hdu.edu.cn/showproblem.php?pid=6206

Topic:

Apple

Time limit:1000/1000 MS (java/others) Memory limit:65535/32768 K (java/others)
Total submission (s): 530 Accepted Submission (s): 172


Problem descriptionapple is Taotao ' s favourite fruit. In his backyard, there is three apple trees with coordinates(x1,y1) ,(x2,y2) , and(x3,y3) . Now Taotao was planning to plant a new one, but he was not willing to take these trees too close. He believes that the new Apple tree should was outside the circle which the three apple trees that already exist are on. Taotao picked a potential position (x,y) of the new tree. Could you tell him if it's outside the circle or not?

Inputthe first line contains an integerT, indicating that there isT(t≤) Cases.
In the first line of all case, there is eight integersX1,Y1, x2 , Y2,x3,y 3, X,y , as described above.
The absolute values of integers in input is less than or equal to 1 , A. .
It is guaranteed this, any three of the four positions does not lie on a straight line.

Outputfor each case, output "Accepted" if the position is outside the circle, or "rejected" if the position are on or insid E The circle.

Sample input3-2 0 0-2 2 0 2-2-2 0 0-2 2 0 0 2-2 0 0-2 2 0 1 1

Sample outputacceptedrejectedrejected

Source2017 ACM/ICPC Asia Regional Qingdao Online ideas: The key is to find the center, if the center knows, the back is good to do. Center coordinate formula from Wiki:

This problem requires a high precision, directly with double or long double will hang.

There are two ways of doing this:

1. To preserve the division operation, it is only possible to use Java BigDecimal (like this)

2. Make a formulation simple:

  

So this is just a matter of comparing molecules, just a large number of templates.

However, I know how to do or wa an afternoon, still did not, not Java, with C + + large number of templates written and written hung ... GG, heartache.

This problem can also be done in a round inversion.

There are no code stickers.

  

hdu6206 Apple ACM/ICPC Asia Regional Qingdao Online

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.