叉乘求凸包面积(多边形也可以), 因为顺时针求出面积为负数,所以最后答案需要加个绝对值。

叉积求出的面积为俩个向量所构成的平行四边行的面积,而本方法是对多边形进行三角剖分,所以需要对结果除二

/*
 * Created by ElegyNine.
 * 诸神天佛,佑我上分!
*/
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int N = 2e5 + 10;
const int M = 1e6 + 12;
const int inf = 0x7fffffff;
const ll INF = 1e18;
const ll mod = 998244353;


const double eps = 1e-6;
const double pi = acos(-1);
int sgn(double x) {
	if(fabs(x) < eps)return 0;
	return x < 0 ? -1 : 1;
}

struct pot {
	double x,y;
	pot(){}
	pot(double x,double y):x(x),y(y){}
	pot operator-(const pot& a) const {return pot(x - a.x,y - a.y);}

	bool operator==(const pot& a) const {return sgn(x - a.x) == 0 && sgn(y - a.y) == 0;}
	bool operator<(const pot& a)const {return sgn(x - a.x) == 0 ? sgn(y - a.y) < 0 : sgn(x - a.x) < 0;}

};

struct line {
	pot p1,p2;
	line(){}
	line(pot p1,pot p2):p1(p1),p2(p2){}
};

double det(pot a,pot b){return a.x * b.y - a.y * b.x;}
double dot(pot a,pot b){return a.x * b.x + a.y * b.y;}


//四舍五入
ll fun(double x) {
	if(x - (ll)x < 0.5)return (ll)x;
	return (ll)x + 1;
}
pot p[N];
void solve() {
	int n;cin >> n;
	for(int i = 0;i < n;i++) {
		 cin >> p[i].x >> p[i].y;
	}

	double area = 0;
	for(int i = 0;i < n;i++) {
		area += det(p[i],p[(i + 1) % n]);
	}

	cout << fun(fabs(area) / 2);

}

int main() {
	ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	//cout << fixed << setprecision(0);
	int t = 1;
	//cin >> t;
	while(t--) {
		solve();
	}
	return 0;
}