#include<bits/stdc++.h> #define Orz ios::sync_with_stdio(0),cin.tie(0) #define rep(i,a,b) for(int i=a;i<=b;i++) #define pii pair<int,int> #define pdd pair<double,double> #define int long long #define ll long long #define ld long double #define N 100001 #define all(x) x.begin(),x.end() #define eps 1e-9 #define x first #define y second
usingnamespace std;
structpt{ int x,y; booloperator < (pt b){ if(x == b.x)return y < b.y; return x < b.x; } booloperator > (pt b){ if(x == b.x)return y > b.y; return x > b.x; } booloperator == (pt b){ if(x-b.x == 0 && y-b.y == 0)returntrue; returnfalse; } pt operator+(pt b) {return {x + b.x, y + b.y};} //向量相加 pt operator-(pt b) {return {x - b.x, y - b.y};} //向量相減 intoperator^(pt b) {return x * b.y - y * b.x;} //向量外積cross intoperator*(pt b) {return x * b.x + y * b.y;} //向量內積dot };
vector<pt> p; vector<int> cnt; int n,edge,ans;
intsolve(){ int area = 0; rep(i,0,n-1){ area += (p[i]^p[i+1]); if(p[i].y == p[i+1].y)edge += abs(p[i].x-p[i+1].x); if(p[i].x == p[i+1].x)edge += abs(p[i].y-p[i+1].y); } area = abs(area); return area; }