HDU - 6206 Apple (2017 ACM-ICPC 亚洲区 (青岛赛区) 网络赛 1001)

2017 ACM/ICPC Asia Regional Qingdao Online 1001


Apple



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

Input
The first line contains an integer  T, indicating that there are  T(T30) cases.
In the first line of each case, there are eight integers  x1,y1,x2,y2,x3,y3,x,y, as described above.
The absolute values of integers in input are less than or equal to  1,000,000,000,000.
It is guaranteed that, any three of the four positions do not lie on a straight line.
 

Output
For each case, output "Accepted" if the position is outside the circle, or "Rejected" if the position is on or inside the circle.
 

Sample Input

3 -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 Output

Accepted Rejected Rejected
 

Source
2017 ACM/ICPC Asia Regional Qingdao Online
 

Recommend
liuyiding
 


解题思路:胜利属于JAVA。我现在只想看看C++高精度怎么做……



import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main (String[] args) {
        Scanner stdin = new Scanner(System.in);
        Main m = new Main();
        int T = stdin.nextInt();
        for(int i=0;i





你可能感兴趣的:(————ACM相关————,——几何——,ACM,-,简单几何)