hiho week 225 register

Ended

Participants:140

Verdict:Accepted
Score:100 / 100
Submitted:2018-10-26 14:21:48

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<cstdio>
using namespace std;
struct Point{
    double x,y;
};
double Cross(Point P,Point A,Point B){
    return (A.x-P.x)*(B.y-P.y)-(A.y-P.y)*(B.x-P.x);
}
int main(){
    int T;
    scanf("%d",&T);
    Point P,A,B,C;
    while(T--){
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&P.x,&P.y,&A.x,&A.y,&B.x,&B.y,&C.x,&C.y);
        double ans1=Cross(A,B,P);
        double ans2=Cross(B,C,P);
        double ans3=Cross(C,A,P);
        if((ans1<=0.00&&ans2<=0.00&&ans3<=0.00)||(ans1>=0.00&&ans2>=0.00&ans3>=0.00)){
            puts("YES");
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX