#include using namespace std; typedef vector vi; typedef pair pii; typedef long long ll; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) struct P{ double x, y; P() {} P(double x, double y) : x(x), y(y){ } P operator + (P p){ return P(x + p.x, y + p.y); } P operator - (P p){ return P(x - p.x, y - p.y); } P operator * (double d){ return P(d*x, d*y); } double dot(P p){ //pとの内積 return x * p.x + y * p.y; } double det(P p){ //pとの外積 return x * p.y - p.x * y; } double dist(P p){ //pとの距離の2乗 return (x-p.x)*(x-p.x) + (y-p.y)*(y-p.y); } //辞書順での比較 bool operator <(const struct P &e) const{ return x == e.x? (y < e.y) : x < e.x; } bool operator >(const struct P &e) const{ return x == e.x? (y > e.y) : x > e.x; } }; vector

convex_hull(P* ps, int n){ sort(ps, ps + n, [](const P& p, const P& q) -> bool { return p qs(n*2); //下側 for (int i = 0;i < n;i++){ while (k > 1 && (qs[k-1] - qs[k-2]).det(ps[i] - qs[k-1]) <= 0) k--; qs[k++] = ps[i]; } //下側 for (int i = n - 2, t = k;i >= 0;i--){ while (k > t && (qs[k-1] - qs[k-2]).det(ps[i] - qs[k-1]) <= 0) k--; qs[k++] = ps[i]; } qs.resize(k-1); return qs; } int main(){ int N = 5; P ps[5]; for(int i=0;i> ps[i].x >> ps[i].y ; } auto qs = convex_hull(ps,N); if(qs.size() == 5){ cout << "YES" << endl; }else{ cout << "NO" << endl; } return 0; }