牛客 F.Random Point in Triangle(数学期望)

#include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    long long x1,y1,x2,y2,x3,y3;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3)
    {
        if(x1*y2==x2*y1&&x1*y3==x3*y1&&x2*y3==x3*y2)
        {
            cout<<'0'<<endl;
            continue;
        }
        long long s=abs(((x1*y2-x2*y1)+(x2*y3-x3*y2)+(x3*y1-x1*y3))*11);
        cout<<s<<endl;
    }
    return 0;
}

copy的WAautomaton

发布了183 篇原创文章 · 获赞 31 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/mlm5678/article/details/96483697