Language: C++

#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <bitset>
#include <climits>
using namespace std;

#define wh while
#define FOR(i, n) for(int i = 0; i < n; i++)
#define REP(i,n) for(int i = 1; i <= n; i++)
#define sf scanf
#define pf printf
#define PB(x) push_back(x)
#define MP(x, y) make_pair(x, y)
#define clr(abc,z) memset(abc,z,sizeof(abc))


typedef long long LL;
typedef long double LD;
typedef pair<int, int> pii;

const double PI = acos(-1.0);

//蟆?ァ貞コヲ霓ャ蛹紋クコ蠑ァ蠎ヲ
double torad(double deg) {
    return deg/180 * PI;
}
//邊セ蠎ヲ
const double eps = 1e-10;
double dcmp(double x) {
    if(fabs(x) < eps) return 0;
    else return x < 0 ? -1 : 1;
}

struct Point {
    double x, y;
    Point(double x=0, double y=0):x(x),y(y) { }
};
typedef Point Vector;
Vector operator + (const Vector& A, const Vector& B) {
    return Vector(A.x+B.x, A.y+B.y);
}
Vector operator - (const Point& A, const Point& B) {
    return Vector(A.x-B.x, A.y-B.y);
}
Vector operator * (const Vector& A, double p) {
    return Vector(A.x*p, A.y*p);
}

//霑吩ク?摎譏ッ荳?ウサ蛻怜渕遑?桃菴?double Dot(const Vector& A, const Vector& B) {
    return A.x*B.x + A.y*B.y;
}
double Cross(const Vector& A, const Vector& B) {
    return A.x*B.y - A.y*B.x;    //蟆アA蜥沓逧?ァッ
}
bool operator < (const Point& p1, const Point& p2) {
    return p1.x < p2.x || (p1.x == p2.x && p1.y < p2.y);
}
bool operator == (const Point& p1, const Point& p2) {
    return p1.x == p2.x && p1.y == p2.y;
}
vector<Point> ConvexHull(vector<Point> p) {//豎る?譌カ髓亥?蛹?    sort(p.begin(), p.end()); // 鬚?、?炊?悟唖髯、驥榊、咲せ
    p.erase(unique(p.begin(), p.end()), p.end());

    int n = p.size();
    int m = 0;
    vector<Point> ch(n+1);
    for(int i = 0; i < n; i++) {
        while(m > 1 && Cross(ch[m-1]-ch[m-2], p[i]-ch[m-2]) <= 0) m--;
        ch[m++] = p[i];
    }
    int k = m;
    for(int i = n-2; i >= 0; i--) {
        while(m > k && Cross(ch[m-1]-ch[m-2], p[i]-ch[m-2]) <= 0) m--;
        ch[m++] = p[i];
    }
    if(n > 1) m--;
    ch.resize(m);
    return ch;
}
Point GetLineIntersection(const Point& P, const Vector& v, const Point& Q, const Vector& w) {
    Vector u = P-Q;
    double t = Cross(w, u) / Cross(v, w);
    return P+v*t;
}

bool SegmentProperIntersection(const Point& a1, const Point& a2, const Point& b1, const Point& b2) {
    double c1 = Cross(a2-a1,b1-a1), c2 = Cross(a2-a1,b2-a1),
           c3 = Cross(b2-b1,a1-b1), c4=Cross(b2-b1,a2-b1);
    return dcmp(c1)*dcmp(c2)<0 && dcmp(c3)*dcmp(c4)<0;
}

bool OnSegment(const Point& p, const Point& a1, const Point& a2) {
    return dcmp(Cross(a1-p, a2-p)) == 0 && dcmp(Dot(a1-p, a2-p)) < 0;
}
int IsPointInPolygon(const Point& p, const vector<Point>& poly) {
    int wn = 0;
    int n = poly.size();
    for(int i = 0; i < n; i++) {
        const Point& p1 = poly[i];
        const Point& p2 = poly[(i+1)%n];
        if(p1 == p || p2 == p || OnSegment(p, p1, p2)) return -1; // 蝨ィ霎ケ逡御ク?        int k = dcmp(Cross(p2-p1, p-p1));
        int d1 = dcmp(p1.y - p.y);
        int d2 = dcmp(p2.y - p.y);
        if(k > 0 && d1 <= 0 && d2 > 0) wn++;
        if(k < 0 && d2 <= 0 && d1 > 0) wn--;
    }
    if (wn != 0) return 1; // 蜀?Κ
    return 0; // 螟夜Κ
}
bool ConvexPolygonDisjoint(const vector<Point> ch1, const vector<Point> ch2) {
    int c1 = ch1.size();
    int c2 = ch2.size();
    for(int i = 0; i < c1; i++)
        if(IsPointInPolygon(ch1[i], ch2) != 0) return false; // 蜀?Κ謌冶セケ逡御ク?    for(int i = 0; i < c2; i++)
        if(IsPointInPolygon(ch2[i], ch1) != 0) return false; // 蜀?Κ謌冶セケ逡御ク?    for(int i = 0; i < c1; i++)
        for(int j = 0; j < c2; j++)
            if(SegmentProperIntersection(ch1[i], ch1[(i+1)%c1], ch2[j], ch2[(j+1)%c2])) return false;
    return true;
}
int n, m;

int main() {
    wh(sf("%d%d", &n, &m) != EOF) {
        if(!n && !m) break;
        vector<Point> _x, _y;
        _x.clear();
        _y.clear();
        FOR(i, n) {
            int x, y;
            sf("%d%d", &x, &y);
            _x.PB(Point((double)x, (double)y));
        }
        FOR(i, m) {
            int x, y;
            sf("%d%d", &x, &y);
            _y.PB(Point((double)x, (double)y));
        }
        _x = ConvexHull(_x);
        _y = ConvexHull(_y);
        if(ConvexPolygonDisjoint(_x, _y)) puts("YES");
        else puts("NO");
    }
}

Compiler output:
a.cc:61:5: error: expected unqualified-id before 'return'
   61 |     return A.x*B.x + A.y*B.y;
      |     ^~~~~~
a.cc:62:1: error: expected declaration before '}' token
   62 | }
      | ^
a.cc: In function 'bool OnSegment(const Point&, const Point&, const Point&)':
a.cc:104:49: error: 'Dot' was not declared in this scope
  104 |     return dcmp(Cross(a1-p, a2-p)) == 0 && dcmp(Dot(a1-p, a2-p)) < 0;
      |                                                 ^~~
a.cc: In function 'int IsPointInPolygon(const Point&, const std::vector<Point>&)':
a.cc:115:12: error: 'k' was not declared in this scope
  115 |         if(k > 0 && d1 <= 0 && d2 > 0) wn++;
      |            ^
a.cc:116:12: error: 'k' was not declared in this scope
  116 |         if(k < 0 && d2 <= 0 && d1 > 0) wn--;
      |            ^
a.cc: In function 'bool ConvexPolygonDisjoint(std::vector<Point>, std::vector<Point>)':
a.cc:126:33: error: 'i' was not declared in this scope
  126 |         if(IsPointInPolygon(ch2[i], ch1) != 0) return false; // 蜀?Κ謌冶セケ逡御ク?    for(int i = 0; i < c1; i++)
      |                                 ^
a.cc:128:46: error: 'i' was not declared in this scope
  128 |             if(SegmentProperIntersection(ch1[i], ch1[(i+1)%c1], ch2[j], ch2[(j+1)%c2])) return false;
      |                                              ^