#include <bits/stdc++.h>
using namespace std;
int n;
struct node
{
int x;
int y;
};
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
node a[n];
double ans = 0;
for(int i = 1; i <= n; i++)
{
cin >> a[i].x >> a[i].y;
}
for(int i = 1; i < n - 1; i++)
{
for(int j = i + 1; j < n; j++)
{
for(int k = j + 1; k <= n; k++)
{
int x1 = a[i].x;
int y1 = a[i].y;
int x2 = a[j].x;
int y2 = a[j].y;
int x3 = a[k].x;
int y3 = a[k].y;
double a = sqrt(pow(abs(x1- x2),2) + pow(abs(y1 - y2),2));
double b = sqrt(pow(abs(x1- x3),2) + pow(abs(y1 - y3),2));
double c = sqrt(pow(abs(x2 - x3),2) + pow(abs(y2 - y3),2));
if(((a + b) > c) && ((a + c) > b) && ((b + c) > a))
{
double s = (a + b + c) / 2;
ans += sqrt(s * (s - a) * (s - b) * (s - c));
}
}
}
}
printf("%.1lf",ans);
return 0;
}
52分,剩下的全TLE了。
哪位神犇帮我调一下