正解证明:https://www.cnblogs.com/WAautomaton/p/11211864.html
(着实看不懂。。。。。太菜了。)
当然也可以随机数确定点P,多随机几个点,便可以得到36E是其面积的10点多倍。因为是整数,11倍即可。
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e3;
struct point
{ ll x,y;
}ps[10];
ll S(int n)
{
ll ans=ps[0].y*(ps[n-1].x-ps[1].x);
for(int i=1;i<3;i++)
{
ans+=ps[i].y*(ps[i-1].x-ps[(i+1)%n].x);
}
if(ans<0) ans=-ans;//顺序不确定
return ans;
}
int main(void)
{
double s;
ll ans;
while(~scanf("%lld%lld%lld%lld%lld%lld",&ps[0].x,&ps[0].y,&ps[1].x,&ps[1].y,&ps[2].x,&ps[2].y))
{
ans=11*S(3);
printf("%lld\n",ans);
}
return 0;
}
/*
1 1 5 6 4 9
*/