criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
#define lld long long int
#define ld long double
#define mod 1000000007
#define modd 998244353
#define all(v) v.begin(),v.end()
#define rep(i,a,b)	for(lld i=a;i<=b;i++)
#define repr(i,a,b) for(lld i=a;i>=b;i--)
#define ar array
#define pb push_back
#define mp make_pair
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
lld n,m,r,c;
lld arr[300000];
vector<ar<lld,3> >bor;
bool comp(ar<lld,3> a,ar<lld,3> b){
    if (a[0]==b[0]){
        if (a[0]){
                return a[1]>b[1];
        }
        else {
            return a[1]<b[1];
        }
    }
    else {
        if (a[1]==b[1]){
            if (a[1]){
                return a[0]<b[0];
            }
            else {
                return a[0]>b[0];
            }
        }
        else {
            if (a[0]==0) return true;
            if (a[1]==0) return false;
            if (a[0]==r) {
                if (b[1]==0) return true;
                else return false;
            }
            if (b[1]==0||b[0]==r)return true;
            return false;
        }
    }
}
int main()
{
     ios;
     lld TESTS,q,a,s,b,l,k,p,h,w,d,x,y,z,xs,ys,t;
     TESTS=1;
  // cin>>TESTS;
     while(TESTS--)
     {
         cin>>r>>c>>n;
         lld ans=0;
         //bool pos1=false,pos2=false;
         rep(i,0,n-1){
            cin>>x>>y>>a>>b;
            if (((x==0||x==r)&&(y==0||y==r))&&((a==0||a=r)&&(b==0||b==r))){
                bor.pb({x,y,i});
                bor.pb({a,b,i});
            }
         }
         bool pos=true;
         sort(all(bor),comp);
         m=bor.size();
         rep(i,0,m/2-1) if (bor[i][2]!=bor[m-1-i][2])pos=false;
         (pos)?cout<<"YES":cout<<"NO";
     }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:53: error: lvalue required as left operand of assignment
   60 |             if (((x==0||x==r)&&(y==0||y==r))&&((a==0||a=r)&&(b==0||b==r))){
      |                                                 ~~~~^~~
Language: C++

#include <bits/stdc++.h>
#include "../lib/lazysegmenttree/lazy_segtree_add_sum.hpp"

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int r, c, n; cin >> r >> c >> n;

  LazySegmentTreeAddSum st(vi((r+c)*2));

  bool ok = true;
  for(int i=0;i<n;++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
    if((x1 == 0 || x1 == r || y1 == 0 || y1 == c) && (x2 == 0 || x2 == r || y2 == 0 || y2 == c)) {
      int tmp1 = 0, tmp2 = 0;
      int res1 = 0, res2 = 0;
      if(y1 == 0) {
        res1 = st.getsum(x1, x1+1);
        tmp1 = x1;
      } else if(x1 == r) {
        res1 = st.getsum(r+y1, r+y1+1);
        tmp1 = r + y1;
      } else if(y1 == c) {
        res1 = st.getsum(r + c + r - x1, r + c + r - x1 + 1);
        tmp1 = r + c + r - x1;
      } else {
        res1 = st.getsum(r + c + r + c - y1, r + c + r + c - y1 + 1);
        tmp1 = r + c + r + c - y1;
      }

      if(y2 == 0) {
        res2 = st.getsum(x2, x2 + 1);
        tmp2 = x2;
      } else if(x2 == r) {
        res2 = st.getsum(r + y2, r + y2 + 1);
        tmp2 = r + y2;
      } else if(y2 == c) {
        res2 = st.getsum(r + c + r - x2, r + c + r - x2 + 1);
        tmp2 = r + c + r - x2;
      } else {
        res2 = st.getsum(r + c + r + c - y2, r + c + r + c - y2 + 1);
        tmp2 = r + c + r + c - y2;
      }
      if(res1 != res2) {
        ok = false;
      }
      st.add(min(tmp1, tmp2), max(tmp1, tmp2), 1);
    }
  }
  cout << (ok ? "YES" : "NO") << endl;
}


Compiler output:
a.cc:2:10: fatal error: ../lib/lazysegmenttree/lazy_segtree_add_sum.hpp: No such file or directory
    2 | #include "../lib/lazysegmenttree/lazy_segtree_add_sum.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <functional>
#include <cassert>
#include <cmath>
#include <string>
using namespace std;

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll; typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename A,size_t N,typename T>void Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);}
const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 2;
//template end

int r,c,n;
int calc(int x,int y){
	if(y==0)return x;
	else if(x==r)return r+y;
	else if(y==c)return r+c+r-x;
	else if(x==0)return r+c+r+c-y;
	else return -1;
}

int main(){
    int n; scanf("%d%d%d",&r,&c,&n);
    vector<P> idx;
    rep(i,0,n){
    	int x1,y1,x2,y2; scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
    	int f1=calc(x1,y1),f2=calc(x2,y2);
    	if(f1==-1||f2==-1)continue;
    	idx.push_back({f1,i});
    	idx.push_back({f2,i});	
	}
	sort(ALL(idx));
	vector<int> st; //stack
	rep(i,0,idx.size()){
		int val=idx[i].second;
		if(st.size()&&st.back()==val)st.pop_back();
		else st.push_back(val);
	}
	printf(st.size()?"NO":"YES");
    return 0;
}


Compiler output:
a.cc:25:17: error: 'INT_MAX' was not declared in this scope
   25 | const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 2;
      |                 ^~~~~~~
a.cc:15:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   14 | #include <string>
  +++ |+#include <climits>
   15 | using namespace std;
a.cc:25:45: error: 'LLONG_MAX' was not declared in this scope
   25 | const int inf = INT_MAX / 2; const ll INF = LLONG_MAX / 2;
      |                                             ^~~~~~~~~
a.cc:25:45: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>

using ll = long long;

#define onWall(x, y) (min({x, r-x, y, c-y}) == 0)

using namespace std;

using P = pair<int, int>;
#define fi first
#define se second

int main() {
    int r, c, n;
    cin >> r >> c >> n;
    vector<int> wall;
    P points[200000];
    for (int i=0, x1, x2, y1, y2; i<n; i++) {
        cin >> x1 >> y1 >> x2 >> y2;
        points[i] = {x1, y1};
        points[i+n] = {x2, y2};
        if (onWall(x1, y1) && onWall(x2, y2)) {
            wall.push_back(i);
            wall.push_back(i+n);
        }
    }
    sort(wall.begin(), wall.end(), [&](int l, int r) {
        P lp = points[l], rp = points[r];
        bool lb = (lp.fi <= lp.se), rb = (rp.fi <= rp.se);
        if (lb ^ rb) return lb > rb;
        else return (bool)(lb ^ lp > rp);
    });
    stack<int> st;
    for (auto w:wall) {
        assert(w < 10000000);
        int r = w % n;
        if (!st.empty() && r == st.top()) st.pop();
        else st.push(r);
    }
    cout << (st.empty() ? "YES" : "NO") << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'assert' was not declared in this scope
   40 |         assert(w < 10000000);
      |         ^~~~~~
a.cc:7:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    6 | #include <stack>
  +++ |+#include <cassert>
    7 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;
 
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
const int mod=1e9+7;

int main(){
  longdouble r,c;int n;cin>>r>>c>>n;
  vector<pair<long double,int>> t;
  int ctr=0;
  rep(i,n){
    long double x1,y1,x2,y2;cin>>x1>>y1>>x2>>y2;
    if((x1!=0&&x1!=c)&&(y1!=0&&y1!=r))continue;
    if((x2!=0&&x2!=c)&&(y2!=0&&y2!=r))continue;
    t.push_back(make_pair(atan2(y1-r/2,x1-c/2),ctr*2));
    t.push_back(make_pair(atan2(y2-r/2,x2-c/2),ctr*2+1));
    ctr++;
  }
  sort(all(t));
  stack<int> s;
  rep(i,t.size()){
    int sc=t[i].second;
    int opp=(sc%2?sc+1:sc-1);
    if(s.empty()||s.top()!=opp){
      s.push(sc);
    }
    else{
      s.pop();
    }
  }
  cout<<(s.size()?"NO":"YES")<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'longdouble' was not declared in this scope; did you mean 'double'?
   17 |   longdouble r,c;int n;cin>>r>>c>>n;
      |   ^~~~~~~~~~
      |   double
a.cc:17:29: error: 'r' was not declared in this scope
   17 |   longdouble r,c;int n;cin>>r>>c>>n;
      |                             ^
a.cc:17:32: error: 'c' was not declared in this scope
   17 |   longdouble r,c;int n;cin>>r>>c>>n;
      |                                ^
Language: C++

#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define BUGAVOID(x) x
#define rep(...) BUGAVOID(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define sz(c) (int)(c.size())
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T, class U>using vp = vector<pair<T, U>>;
template<class T>using vv = vector<vector<T>>; template<class T, class U>using vvp = vv<pair<T, U>>;
template<class T>vv<T> vvec(size_t n, size_t m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 28, MAX = 1e5 + 5, MOD = 1e9 + 7;
constexpr ll LINF = 1ll << 60; constexpr double EPS = 1e-6;
constexpr int dy[4] = { 0,1,0,-1 }, dx[4] = { 1,0,-1,0 };
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

int R, C, N;
vi X1, X2, Y1, Y2;

int main() {
    cin >> R >> C >> N;
    X1.resize(N);
    X2.resize(N);
    Y1.resize(N);
    Y2.resize(N);
    rep(i, N) {
        cin >> X1[i] >> Y1[i] >> X2[i] >> Y2[i];
    }

    // 両端が辺に乗ってるもののみ
    // 左上0反時計回りに座標振る
    vp<int, int> sepa;
    rep(i, N) {
        if ((X1[i] % C && Y1[i] % R) || (X2[i] % C && Y2[i] % R)) continue;

        int crd1 = Y1[i] == 0 ? X1[i] :
            (X1[i] == C ? C + Y1[i] :
            (Y1[i] == R ? R + C + C - X1[i] :
                R + 2 * C + R - Y1[i]));
        int crd2 = Y2[i] == 0 ? X2[i] :
            (X2[i] == C ? C + Y2[i] :
            (Y2[i] == R ? R + C + C - X2[i] :
                R + 2 * C + R - Y2[i]));
        if (crd1 > crd2) swap(crd1, crd2);

        sepa.emplace_back(crd1, crd2);
    }
    sort(all(sepa));

    bool ans = true;
    if (!sepa.empty()) {
        int i = 0;
        while (i < sepa.size()) {
            int border = sepa[i].second;
            int j = i + 1;
            for (; j < sepa.size(); ++j) {
                if (sepa[j].first > border) break;
                else if (sepa[j].second > sepa[j - 1].second) {
                    ans = false;
                }
            }
            i = j;
        }
    }

    write(ans ? "YES" : "NO");


Compiler output:
a.cc: In function 'int main()':
a.cc:71:31: error: expected '}' at end of input
   71 |     write(ans ? "YES" : "NO");
      |                               ^
a.cc:25:12: note: to match this '{'
   25 | int main() {
      |            ^
Language: Java

import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;

public class Main {

    // Complete the minimumNumber function below.
    static int minimumNumber(int n, String password) {
        // Return the minimum number of characters to make the password strong
return 1;
    }

    private static final Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));

        int n = scanner.nextInt();
        scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");

        String password = scanner.nextLine();

        int answer = minimumNumber(n, password);

        bufferedWriter.write(String.valueOf(answer));
        bufferedWriter.newLine();

        bufferedWriter.close();

        scanner.close();
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
    private static final Scanner scanner = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
    private static final Scanner scanner = new Scanner(System.in);
                                               ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    // Complete the minimumNumber function below.
    static int minimumNumber(int n, String password) {
        // Return the minimum number of characters to make the password strong
return 1;
    }

    private static final Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) throws IOException {
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));

        int n = scanner.nextInt();
        scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");

        String password = scanner.nextLine();

        int answer = minimumNumber(n, password);

        bufferedWriter.write(String.valueOf(answer));
        bufferedWriter.newLine();

        bufferedWriter.close();

        scanner.close();
    }
}


Compiler output:
Main.java:9: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
using ii = pair<long, long>;

struct P {
    int x, y;
};

int r, c, n;

long encode(P p) {
    int h = max(r, c);
    if (p.x == 0) {
        return 1 + p.y;
    } else if (p.y == c) {
        return 1 + h + p.x;
    } else if (p.x == r) {
        return 1 + 3 * h - p.y;
    } else {
        return 1 + 4 * h - p.x;
    }
}

int main() {
    cin >> r >> c >> n;
    vector<ii> border;
    auto onBorder = [](int a, int b) {
        return (a == 0 || a == r) || (b == 0 || b == c);
    };
    for (int i = 0; i < n; i++) {
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        if (onBorder(x1, y1) && onBorder(x2, y2)) {
            long e1 = encode({x1, y1}), e2 = encode({x2, y2});
            border.push_back(ii(min(e1, e2), -min(e1, e2)));
            border.push_back(ii(max(e1, e2), min(e1, e2)));
        }
    }
    if (border.empty()) {
        cout << "YES" << endl;
        return 0;
    }
    sort(border.begin(), border.end());
    
    stack<long> st;
    for (ii p: border) {
        if (p.second < 0) {
            st.push(p.second);
        } else {
            assert(!st.empty());
            long t = st.top();
            st.pop();
            if (p.second + t) {
                cout << "NO" << endl;
                return 0;
            }
        }
    }
    cout << "YES" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:13: error: 'assert' was not declared in this scope
   53 |             assert(!st.empty());
      |             ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    4 | #include <stack>
  +++ |+#include <cassert>
    5 | using namespace std;
Language: C++

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <queue>
#include <cmath>
#include <cstring>
#include <string>
#include <iomanip>
#include <fstream> 
#include <deque> 
#include <vector> 
#include <map> 
#include <stack> 
#include <set> 
#define ll long long
#define met(a,0) memset(a,0,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
const int mod=1e9+7;
const int N=1e5+10;
int r, c, n;
stack<int>s;
struct node
{
    int u, v, f;
} st[N*2];
int cmp(node a, node b)
{
    return a.u<b.u;
}
int check(int x, int y)
{
    if(x==0)
        return y;
    else if(y==c)
        return  c+x;
    else if(x==r)
        return r+c+c-y;
    else if(y==0)
        return r+r+c+c-x;
    else
        return -1;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int i,j,k,a,b,cc,d;
    int num=0,ans=0;
    cin>>r>>c>>n;
    for(i=1; i<=n; i++)
    {
        cin>>a>>b>>cc>>d;
        int x=check(a, b), y=check(cc, d);
        if(x==-1||y==-1)
            continue;
        if(x>y)
            swap(x, y);
        st[num].f=1;
        st[num].u=x;
        st[num++].v=y;
        st[num].f=2;
        st[num].u=y;
        st[num++].v=x;
    }
    sort(st+1, st+1+num, cmp);
    for(i=1; i<=num; i++)
    {
        if(st[i].f==1)
            s.push(st[i].v);
        else if(s.top()==st[i].u)
            s.pop();
        else
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
    return 0;
}


Compiler output:
a.cc:18:15: error: expected parameter name, found "0"
   18 | #define met(a,0) memset(a,0,sizeof(a))
      |               ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define met(a,0) memset(a,0,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
const int mod=1e9+7;
const int N=1e5+10;
int r, c, n;
stack<int>s;
struct node
{
    int u, v, f;
} st[N*2];
int cmp(node a, node b)
{
    return a.u<b.u;
}
int dis(int x, int y)
{
    if(x==0)
        return y;
    else if(y==c)
        return  c+x;
    else if(x==r)
        return r+c+c-y;
    else if(y==0)
        return r+r+c+c-x;
    else
        return -1;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int i,j,k,a,b,cc,d;
    int num=0,ans=0;
    cin>>r>>c>>n;
    for(i=1; i<=n; i++)
    {
        cin>>a>>b>>cc>>d;
        int x=dis(a, b), y=dis(cc, d);
        if(x==-1||y==-1)
            continue;
        if(x>y)
            swap(x, y);
        st[num].f=1;
        st[num].u=x;
        st[num++].v=y;
        st[num].f=2;
        st[num].u=y;
        st[num++].v=x;
    }
    sort(st+1, st+1+num, cmp);
    for(i=1; i<=num; i++)
    {
        if(st[i].f==1)
            s.push(st[i].v);
        else if(s.top()==st[i].u)
            s.pop();
        else
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
    return 0;
}


Compiler output:
a.cc:3:15: error: expected parameter name, found "0"
    3 | #define met(a,0) memset(a,0,sizeof(a))
      |               ^
Language: C++

#include<bits/stdC++.h>
using namespace std;
int R,C,N;
struct node{
	int u;
	int v;
	int flag;
}no[200005];
bool cmp(node a,node b)
{
	return a.u < b.u;
}
int Change(int x, int y)
{
    if (x == 0)
        return y;
    else if (y == 0)
        return R + R + R + C + C - x;
    else if (x == R)
        return x +R+C- y;
    else if (y == C)
        return x+y;
    else 
		return -1;
}
int main()
{
	int cnt=0;
	scanf("%d%d%d",&R,&C,&N);
	for(int i=0;i<N;i++)
	{
		int a,b,C,d;
		scanf("%d%d%d%d",&a,&b,&C,&d);
		int flag1=Change(a,b);
		int flag2=Change(C,d);
		if(flag1 == -1 || flag2 == -1)
			continue;
		if(flag1 > flag2)
			swap(flag1,flag2);
		no[cnt].flag=1;
		no[cnt].u=flag1;
		no[cnt++].v=flag2;
		no[cnt].flag=2;
		no[cnt].u=flag2;
		no[cnt++].v=flag1;
	}
	stack<int>S;
	sort(no,no+cnt,cmp);
	for(int i=0;i<cnt;i++)
	{
		if(no[i].flag==1)
			S.push(no[i].v);
		else if(S.top()==no[i].u)
			S.pop();
		else
		{
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdC++.h: No such file or directory
    1 | #include<bits/stdC++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<cstdio>  
#include<fstream>  
#include<iomanip>
#include<algorithm>  
#include<cmath>  
#include<deque>  
#include<vector>  
#include<assert.h>
#include<bitset>
#include<queue>  
#include<string>  
#include<cstring>  
#include<map>  
#include<stack>  
#include<set>
#include<functional>
#define pii pair<int, int>
#define mod 1000000007
#define mp make_pair
#define pi acos(-1)
#define eps 0.00000001
#define mst(a,i) memset(a,i,sizeof(a))
#define all(n) n.begin(),n.end()
#define lson(x) ((x<<1))  
#define rson(x) ((x<<1)|1) 
#define inf 0x3f3f3f3f
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int r, c;
class T {
public:
    int mode, v, ope;
    bool operator<(const T&a)
    {
        return v < a.v;
    }
};
int getnum(int x, int y)
{
    if (x == 0)
        return y;
    else if (y == 0)
        return r+r + r + c + c - x;
    else if (x == r)
        return x +r+c- y;
    else if (y == c)
        return x+y;
    else return -1;
}
 
vector<T>a;
stack<int>sve;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int i, j, k, m, n;
    int x1, x2, y1, y2;
    cin >> r >> c >> n;
    int tempa, tempb;
    for (int i = 1; i <= n; ++i)
    {
        cin >> y1 >> x1 >> y2 >> x2;
        tempa = getnum(x1, y1);
        tempb = getnum(x2, y2);
        if (tempb == -1 || tempa == -1)continue;
        if (tempb < tempa)swap(tempa, tempb);
        a.push_back({ 1,tempa,tempb });
        a.push_back({ 2,tempb,tempa });
    }
    sort(all(a));
    for (int i = 0; i < a.size(); ++i)
    {
        if (a[i].mode == 1)
            sve.push(a[i].ope);
        else if (sve.top() == a[i].v)
                sve.pop();
        else
        {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:5: error: 'cin' was not declared in this scope
   57 |     cin.tie(0);
      |     ^~~
a.cc:17:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   16 | #include<functional>
  +++ |+#include <iostream>
   17 | #define pii pair<int, int>
a.cc:81:13: error: 'cout' was not declared in this scope
   81 |             cout << "NO" << endl;
      |             ^~~~
a.cc:81:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:85:5: error: 'cout' was not declared in this scope
   85 |     cout << "YES" << endl;
      |     ^~~~
a.cc:85:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<queue>

using namespace std;

int n;
int r,c;
int pt[5];
pair<int,int> top[5][100005];

int isedge(int x,int y){
  if(x == 0) return 1;
  if(y == 0) return 4;
  if(x == r) return 3;
  if(y == c) return 2;
  return 0;
}

int main(){
  cin>>r>>c;
  cin>>n;
  for(int i=0;i<n;i++){
    int x1,y1,x2,y2;cin>>x1>>y1>>x2>>y2;
    if((isedge(x1,y1)>0) && (isedge(x2,y2))){
      if(isedge(x1,y1) == 1) top[1][pt[1]++] = make_pair(y1,i);
      if(isedge(x1,y1) == 2) top[2][pt[2]++] = make_pair(x1,i);
      if(isedge(x1,y1) == 3) top[3][pt[3]++] = make_pair(y1,i);
      if(isedge(x1,y1) == 4) top[4][pt[4]++] = make_pair(x1,i);
      if(isedge(x2,y2) == 1) top[1][pt[1]++] = make_pair(y2,i);
      if(isedge(x2,y2) == 2) top[2][pt[2]++] = make_pair(x2,i);
      if(isedge(x2,y2) == 3) top[3][pt[3]++] = make_pair(y2,i);
      if(isedge(x2,y2) == 4) top[4][pt[4]++] = make_pair(x2,i);
    }
  }
  for(int i=0;i<5;i++){
    sort(top[i],top[i]+pt[i]);
  }
  /*for(int i=0;i<5;i++){
    for(int j=0;j<pt[i];j++)cout<<top[i][j].first<<" "<<top[i][j].second<<endl;
  }*/
  bool ans = true;
  int pp=0;
  pair<int,int> stack[100005];
  for(int i=0;i<pt[1];i++){
    if(pp == 0){
      stack[pp++] = top[1][i];
    } else {
      if(stack[pp-1].second == top[1][i].second){
        pp--;
      } else {
        stack[pp++] = top[1][i];
      }
    }
  }
  for(int i=0;i<pt[2];i++){
    if(pp == 0){
      stack[pp++] = top[2][i];
    } else {
      if(stack[pp-1].second == top[2][i].second){
        pp--;
      } else {
        stack[pp++] = top[2][i];
      }
    }
  }
  for(int i=pt[3]-1;i>=0;i--){
    if(pp == 0){
      stack[pp++] = top[3][i];
    } else {
      if(stack[pp-1].second == top[3][i].second){
        pp--;
      } else {
        stack[pp++] = top[3][i];
      }
    }
  }
  for(int i=pt[4]-1;i>=0;i--){
    if(pp == 0){
      stack[pp++] = top[4][i];
    } else {
      if(stack[pp-1].second == top[4][i].second){
        pp--;
      } else {
        stack[pp++] = top[4][i];
      }
    }
  }
  if(pp == 0){
    cout<<"Yes"<<endl;
  } else {
    cout<<"No"<<endgl;
  }
  //cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:98:17: error: 'endgl' was not declared in this scope
   98 |     cout<<"No"<<endgl;
      |                 ^~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define int long long
typedef pair<int,int> ii;
typedef pair<ii,ii> iiii;
iiii x[1000005];
vector<ii> vec[10];
int r,c,n,cnt;
stack<int> st;
//0 là cột bên trái
//1 là hàng ở trên
//2 là cột bên phải
//3 là hàng ở dưới
void qualify(int x1,int y1,int x2,int y2,int num){
    int count1=0,count2=0;
    if(y1==0&&count1==0){
        vec[0].pb(mp(x1,num));
        count1++;
    }
    if(y1==c&&count1==0){
        count1++;
        vec[2].pb(mp(x1,num));
    }
    if(y2==0&&count2==0){
        count2++;
        vec[0].pb(mp(x2,num));
    }
    if(y2==c&&count2==0){
        count2++;
        vec[2].pb(mp(x2,num));
    }
    if(x1==0&&count1==0){
        count1++;
        vec[1].pb(mp(y1,num));
    }
    if(x1==r&&count1==0){
        count1++;
        vec[3].pb(mp(y1,num));
    }
    if(x2==0&&count2==0){
        count2++;
        vec[1].pb(mp(y2,num));
    }
    if(x2==r&&count2==0){
        count2++;
        vec[3].pb(mp(y2,num));
    }
}
bool cmp(const ii &a,const ii &b){
    return a.fi<b.fi;
}
bool cmp1(const ii &a,const ii &b){
    return a.fi>b.fi;
}
int main(){
    ios::sync_with_stdio(0);
    cin>>r>>c>>n;
    for(int i=1;i<=n;i++)
        cin>>x[i].fi.fi>>x[i].fi.se>>x[i].se.fi>>x[i].se.se;
    for(int i=1;i<=n;i++){
        int count1=0,count2=0;
        if(x[i].fi.fi==0||x[i].fi.fi==r)
            count1++;
        if(x[i].se.fi==0||x[i].se.fi==r)
            count1++;
        if(x[i].fi.se==0||x[i].fi.se==c)
            count2++;
        if(x[i].se.se==0||x[i].se.se==c)
            count2++;
        if(count1>=2||count2>=2)
        qualify(x[i].fi.fi,x[i].fi.se,x[i].se.fi,x[i].se.se,i);
    }
    sort(vec[0].begin(),vec[0].end(),cmp1);
    sort(vec[1].begin(),vec[1].end(),cmp);
    sort(vec[2].begin(),vec[2].end(),cmp);
    sort(vec[3].begin(),vec[3].end(),cmp1);
    for(int i=0;i<=3;i++){
        for(int j=0;j<vec[i].size();j++){
            if(!st.empty()){
                if(vec[i][j].se==st.top())
                    st.pop();
                else
                    st.push(vec[i][j].se);
            }
            else
                st.push(vec[i][j].se);
        }
    }
    if(!st.empty())
        cout<<"NO";
    else
        cout<<"YES";
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
typedef pair<int, int> P;

int r, c, n;

bool onLine(int x, int y) {
	if (x == 0 || y == 0 || x == r || y == c) return true;
	return false;
}

int which(int x, int y) {
	if (x == 0 && y == c) return 1;
	if (x == 0 && y == 0) return 2;
	if (x == r && y == 0) return 3;
	if (x == r && y == c) return 4;
	if (y == c) return 5;
	if (x == 0) return 6;
	if (y == 0) return 7;
	if (x == r) return 8;
	return 0;
}

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> r >> c >> n;
	vector<pair<P, P> > v;
	bool yoko = false, tate = false, lna = false, rna = false;
	FOR(i, n) {
		int x, y, u, v;
		cin >> x >> y >> u >> v;
		if (onLine(x, y) && onLine(u, v)) {
			int xy = which(x, y), uv = which(u, v);
			if (xy == 1) {
				if (uv == 2 || uv == 7) yoko = true;
				if (uv == 3) lna = true;
				if (uv == 4 || uv == 8) tate = true;
			}
			else if (xy == 2) {
				if (uv == 1 || uv == 5) yoko = true;
				if (uv == 4) rna = true;
				if (uv == 3 || uv == 8) tate = true;
			}
			else if (xy == 3) {
				if (uv == 4 || uv == 5) yoko = true;
				if (uv == 1) lna = true;
				if (uv == 2 || uv == 6) tate = true;
			}
			else if (xy == 4) {
				if (uv == 3 || uv == 7) yoko = true;
				if (uv == 2) rna = true;
				if (uv == 1 || uv == 6) tate = true;
			}
			else if (xy == 5) {
				if (uv == 2 || uv == 3 || uv == 7) yoko = true;
			}
			else if (xy == 6) {
				if (uv == 3 || uv == 4 || uv == 8) tate = true;
			}
			else if (xy == 7) {
				if (uv == 1 || uv == 4 || uv == 5) yoko = true;
			}
			else if (xy == 8) {
				if (uv == 1 || uv == 2 || uv == 6) tate = true;
			}
			v.push_back({{x, y}, {u, v}});
		}
	}
	if ((yoko && tate) || (lna && (yoko || tate)) || (rna && (yoko || tate))) cout << "NO" << endl;
	else cout << "YES" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:71:27: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   71 |                         v.push_back({{x, y}, {u, v}});
      |                           ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
int R, C, N;
struct Point {
    int x, y, id;
};
vector<Point> P;
Point st;

ll cross(pii a, pii b) {
    return 1LL*a.first*b.second - 1LL*a.second*b.first;
}
ll ccw(Point a, Point b, Point c) {
    pii p = pii(b.x - a.x, b.y - a.y);
    pii q = pii(c.x - a.x, c.y - a.y);
    return cross(p, q);
}
bool cmp(Point a, Point b) {
    if(ccw(st, a, b)) return ccw(st, a, b) > 0;
    else return abs(a.x - st.x) + abs(a.y - st.y) < abs(b.x - st.x) + abs(b.y - st.y);
}

int main() {
    scanf("%d %d %d", &R, &C, &N);
    st = {2e9, 2e9, 2e9};
    for(int i = 0; i < N; i++) {
        int x1, y1, x2, y2; scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
        if((x1 == 0 || x1 == R || y1 == 0 || y1 == C) && (x2 == 0 || x2 == R || y2 == 0 || y2 == C)) {
            P.push_back({x1, y1, i});
            P.push_back({x2, y2, i});
        }
    }

    if(P.size() == 0) {
        printf("YES");
        return 0;
    }

    for(int i = 0; i < P.size(); i++) {
        if(st.y > P[i].y || (st.y == P[i].y && st.x > P[i].x)) {
            st = P[i];
        }
    }

    sort(P.begin(), P.end(), cmp);

    stack<int> stk;

    for(int i = 0; i < P.size(); i++) {
        if(!stk.empty() && stk.top() == P[i].id) stk.pop();
        else stk.push(P[i].id);
    }

    if(stk.empty()) printf("YES");
    else printf("NO");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:11: error: narrowing conversion of '2.0e+9' from 'double' to 'int' [-Wnarrowing]
   28 |     st = {2e9, 2e9, 2e9};
      |           ^~~
Language: C++

#include <bits/stdc++.h>
#define fr(a, b, c) for(int a = b, __ = c; a < __; a++)
#define dbg(x) cerr << ">>>>> " << x << endl;
#define _ << " , " <<

#define X first
#define Y second

using namespace std;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef long long ll;
const ll inf = ll(1e9) + 7;
const int ms = 1111111;

struct Point{
	ll x, y;
	int id;
	Point(ll x, ll y, int id):x(x), y(y), id(id){}
	
	ll operator%(Point &p) const {
		return x*p.y - y*p.x;
	}

	ll operator!(){
		return x*x + y*y;
	}
};

bool operator<(Point p1, Point p2){
	ll pv = p1 % p2;
	ll pv = p1 % p2;
	if(pv == 0){
        if(p1.y == 0)
			return !(p1) < !(p2);
        else 
        	return !(p1) > !(p2)
	}
	else{
		return pv > 0;
	}
}

int mk[ms];

int main(){
	ios::sync_with_stdio(0);
	int r, c, n;
	cin >> r >> c >> n;
	vector<Point> v;
	fr(i, 0, n){
		int x1, x2, y1, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		bool b1 = x1 == 0 || x1 == r || y1 == 0 || y1 == c,
		b2 = x2 == 0 || x2 == r || y2 == 0 || y2 == c;
		if(b1 && b2){
			v.push_back(Point(x1, y1, i));
			v.push_back(Point(x2, y1, i));
		}
	}
	sort(v.begin(), v.end());
	bool ok = 1;
	stack<int> pilha;
	for(Point p : v){
		if(mk[p.id]){
			if(pilha.top() != p.id){
				ok = 0;
				break;
			}
			pilha.pop();
		}
		else{
			mk[p.id] = 1;
			pilha.push(p.id);
		}
	}
	puts(ok ? "YES" : "NO");
	return 0;
}

Compiler output:
a.cc: In function 'bool operator<(Point, Point)':
a.cc:32:12: error: redeclaration of 'll pv'
   32 |         ll pv = p1 % p2;
      |            ^~
a.cc:31:12: note: 'll pv' previously declared here
   31 |         ll pv = p1 % p2;
      |            ^~
a.cc:37:37: error: expected ';' before '}' token
   37 |                 return !(p1) > !(p2)
      |                                     ^
      |                                     ;
   38 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
#define fr(a, b, c) for(int a = b, __ = c; a < __; a++)
#define dbg(x) cerr << ">>>>> " << x << endl;
#define _ << " , " <<

#define X first
#define Y second

using namespace std;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef long long ll;
const ll inf = ll(1e9) + 7;
const int ms = 1111111;

struct Point{
	ll x, y;
	int id;
	Point(ll x, ll y, int id):x(x), y(y), id(id){}
	
	ll operator%(Point &p) const {
		return x*p.y - y*p.x;
	}

	ll operator!(){
		return x*x + y*y;
	}
};

bool operator<(Point p1, Point p2){
	ll pv = p1 % p2;
	if(pv == 0){
		return !(p1) < !(p2);
	}
	else{
		return pv > 0;
	}
}

int mk

int main(){
	ios::sync_with_stdio(0);
	int r, c, n;
	cin >> r >> c >> n;
	vector<Point> v;
	fr(i, 0, n){
		int x1, x2, y1, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		bool b1 = x1 == 0 || x1 == r || y1 == 0 || y1 == c,
		b2 = x2 == 0 || x2 == r || y2 == 0 || y2 == c;
		if(b1 && b2){
			v.push_back(Point(x1, y1, i));
			v.push_back(Point(x2, y1, i));
		}
	}
	sort(v.begin(), v.end());
	bool ok = 1;
	stack<int> pilha;
	for(Point p : v){
		if(mk[p.id]){
			if(pilha.top() != p.id){
				ok = 0;
				break;
			}
			pilha.pop();
		}
		else{
			mk[p.id] = 1;
			pilha.push(p.id);
		}
	}
	puts(ok ? "YES" : "NO");
	return 0;
}

Compiler output:
a.cc:42:1: error: expected initializer before 'int'
   42 | int main(){
      | ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <climits>
#include <list>
#include <unordered_map>
#include <utility>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using namespace std;
int R,C,N;

int length(int x,int y){
    if(y==0){
        return x;
    }
    if(x==0){
        return 2*(R+C)-y;
    }
    if(x==R){
        return R+y;
    }
    return 2*R+C-x;
}

bool comp(pair<int,int>& p1,pair<int,int>& p2){
    return p1.first - p2.first;
}

int main() {
    cin>>R>>C>>N;
    pair<int,int> ;
    vector<pair<int,int>> border;

    REP(i,N){
        int x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        if ((x1%R==0||y1%C==0)&&(x2%R==0||y2%C==0)){
            border.push_back(pair<int,int>(length(x1,y1),i+1));//   [length(x1,y1)]=i+1;
            border.push_back(pair<int,int>(length(x2,y2),i+1));
        }
    }
    sort(border.begin(),border.end(),comp);

    stack<int> pos;
    pos.push(-1);

    REP(i,border.size()) {
        if(pos.top()!=border[i].second){
                pos.push(border[i].second);
            }else{
                pos.pop();
            }
    }

    if(pos.size()==1){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:5: error: declaration does not declare anything [-fpermissive]
   44 |     pair<int,int> ;
      |     ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <climits>
#include <list>
#include <unordered_map>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using namespace std;
int R,C,N;

int length(int x,int y){
    if(y==0){
        return x;
    }
    if(x==0){
        return 2*(R+C)-y;
    }
    if(x==R){
        return R+y;
    }
    return 2*R+C-x;
}

bool comp(pair<int,int>& p1,pair<int,int>& p2){
    return p1.first - p2.first;
}

int main() {
    cin>>R>>C>>N;
    pair<int,int> ;
    vector<pair<int,int>> border;

    REP(i,N){
        int x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        if ((x1%R==0||y1%C==0)&&(x2%R==0||y2%C==0)){
            border.push_back(pair<int,int>(length(x1,y1),i+1));//   [length(x1,y1)]=i+1;
            border.push_back(pair<int,int>(length(x2,y2),i+1));
        }
    }
    sort(border.begin(),border.end(),comp);

    stack<int> pos;
    pos.push(-1);

    REP(i,border.size()) {
        if(pos.top()!=border[i].second){
                pos.push(border[i].second);
            }else{
                pos.pop();
            }
    }

    if(pos.size()==1){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:5: error: declaration does not declare anything [-fpermissive]
   43 |     pair<int,int> ;
      |     ^~~~~~~~~~~~~
Language: C++

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
const int MOD = 1e9 + 7;

bool judge(ll xi, ll yi, ll xj, ll yj,ll xk,ll yk,ll xl,ll yl) {
	if (xi == xj) {
		return (xi - xk)*(xi - xl) > 0;
	}
	else {
		return  ((yi - yj)*xk - (xi - xj)*yk + (xi*yj - xj*yi))*((yi - yj)*xl - (xi - xj)*yl + (xi*yj - xj*yi)) > 0;
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	ll r, c; cin >> r >> c;
	ll n; cin >> n;
	vector<pair<P, P>> v;
	for (int i = 0; i < n; i++) {
		ll xi, yi, xj, yj;
		cin >> xi >> yi >> xj >> yj;
		if ((xi == 0 || xi == r) || (yi == 0 || yi == c)) {
			if ((xj == 0 || xj == r) || (yj == 0 || yj == c)) {
				v.push_back(make_pair(P(xi, yi), P(xj, yj)));
			}
		}
	}
	bool flag = true;
	int sz = v.size();
	for (int i = 0; i < sz; i++) {
		for (int j = i + 1; j < sz; j++) {
			ll xi = v[i].first.first, yi = v[i].first.second, xj = v[j].second.first, yj = v[j].second.second;
			ll xk = v[k].first.first, yk = v[k].first.second, xl = v[l].second.first, yl = v[l].second.second;
			flag &= judge(xi, yi, xj, yj, xk, yk, xl, yl);
		}
	}
	if (flag) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:35: error: 'k' was not declared in this scope; did you mean 'xk'?
   45 |                         ll xk = v[k].first.first, yk = v[k].first.second, xl = v[l].second.first, yl = v[l].second.second;
      |                                   ^
      |                                   xk
a.cc:46:59: error: 'yk' was not declared in this scope; did you mean 'xk'?
   46 |                         flag &= judge(xi, yi, xj, yj, xk, yk, xl, yl);
      |                                                           ^~
      |                                                           xk
a.cc:46:63: error: 'xl' was not declared in this scope; did you mean 'xk'?
   46 |                         flag &= judge(xi, yi, xj, yj, xk, yk, xl, yl);
      |                                                               ^~
      |                                                               xk
a.cc:46:67: error: 'yl' was not declared in this scope; did you mean 'yj'?
   46 |                         flag &= judge(xi, yi, xj, yj, xk, yk, xl, yl);
      |                                                                   ^~
      |                                                                   yj
Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<fstream>
#include<cstdlib> 
#include<string>
#include<math.h>
#include<bitset>
#include<algorithm>
#include<vector>
#include<set>
#include<stack>
#include<queue>
using namespace std;
typedef unsigned long long ull;

bool judgeIentersected(ull ax, ull ay, ull bx, ull by, ull cx, ull cy, ull dx, ull dy) {
  ull ta = (cx - dx) * (ay - cy) + (cy - dy) * (cx - ax);
  ull tb = (cx - dx) * (by - cy) + (cy - dy) * (cx - bx);
  ull tc = (ax - bx) * (cy - ay) + (ay - by) * (ax - cx);
  ull td = (ax - bx) * (dy - ay) + (ay - by) * (ax - dx);

  return tc * td < 0 && ta * tb < 0;
  // return tc * td <= 0 && ta * tb <= 0; // 端点を含む場合
};

int main(){
 
	unsigned long long r,c,n;
	cin>>r>>c>>n;
	
	unsigned long long sx[100000]={};
	unsigned long long sy[100000]={};
	unsigned long long gx[100000]={};
	unsigned long long gy[100000]={};
	bool linej[100000]={};
	
	for(int i=0;i<n;i++){
	    cin >> sx[i] >> sy[i] >> gx[i] >> gy[i];
	    if((sx[i]==0 || sx[i]==r||sy[i]==0 || sy[i]==c)&&(gx[i]==0 || gx[i]==r||gy[i]==0 || gy[i]==c)){
	        linej[i]=1;
	    }
	    //cout << linej[i] << endl;
	}
	
	for(int i=0;i<n;i++){
	    for(int j=i+1;j<n;j++){
	        //cout << i <<j << endl;
	        if(linej[i] && linej[j]){
	            //bool ans=judgeIentersected(sx[i],sy[i],gx[i],gy[i],sx[j],sy[j],gx[j],gy[j]);
	            cout << "i=" << i << ", j=" << j << ", ans=" << ans << endl;
	            if(ans){
	                cout << "NO" << endl;
	                return 0;
	            }
	        }
	    }
	}
	cout << "YES" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:69: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |                     cout << "i=" << i << ", j=" << j << ", ans=" << ans << endl;
      |                                                                     ^~~
      |                                                                     abs
Language: C++

#Include <stdio.h>
int main(){
printf("NO\n");
return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include <stdio.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:3:1: error: 'printf' was not declared in this scope
    3 | printf("NO\n");
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #Include <stdio.h>
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7;
int r,c,n;
int get(int x, int y){
    if(x > 0 && x < r && y > 0 && y < c)
        return -1;
    int ans = 0;
    if(x == 0)
        return y;
    else
        ans += c;
    if(y == c)
        return ans + x;
    else
        ans += r;
    if(x == r)
        return ans + (c-y);
    else
        ans += c;
    return ans + (r-x);
}
const int N = 1e6+5;
int ftree[N];
void fadd(int x){
    for(int i = x; i < N; i += i&(-i))
        ftree[i]++;
}
int fget(int x){
    int ans = 0;
    for(int i = x; i > 0; i -= i&(-i))
        ans += ftree[i];
    return ans;
}
int main(){
    cin >> r >> c >> n;
    vector<pair<int,int> > moves;
    for(int i = 0; i < n; ++i){
        int x1,y1,x2,y2;
        cin >> x1 >> y1 >> x2 >> y2;
        int a = get(x1,y1);
        int b = get(x2,y2);
        if(a == -1 || b == -1)
            continue;
        if(a > b)
            b += 2*(r+c);
        moves.push_back({a,b});
        moves.push_back({a+2*(r+c),b+2*(r+c)});
    }
    sort(moves.begin(),moves.end());
    n = moves.size();
    // [...............(.................]................)
    vector<int> all;
    for(auto cur : moves){
        all.push_back(cur.first);
        all.push_back(cur.first+1);
        all.push_back(cur.second);
        all.push_back(cur.second-1);
    }
    sort(all.begin(),all.end());
    all.erase(unique(all.begin(),all.end()),all.end());
    for(auto &cur : moves){
        cur.first = lower_bound(all.begin(),all.end(),cur.first)-all.begin()+1;
        cur.second = lower_bound(all.begin(),all.end(),cur.second)-all.begin()+1;
    }
    bool ok = true;
    int l = 0;
    for(int i = 0; i < n; ++i){
        while(moves[l].first < moves[i].first)
            fadd(moves[l++].second);
        if(moves[i].first+1 >= moves[i].second)
            continue;
        /cout << moves[i].first << ' ' << moves[i].second << '\n';
        //cout << "fget: " << fget(moves[i].second-1) << ' ' << fget(moves[i].first) << '\n';
        if(fget(moves[i].second-1)-fget(moves[i].first))
            ok = false;
    }
    if(!ok)
        puts("NO");
    else
        puts("YES");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:9: error: expected primary-expression before '/' token
   74 |         /cout << moves[i].first << ' ' << moves[i].second << '\n';
      |         ^
Language: C++

#include <bits/stdc++.h>
#define double long double
#define N 100010
using namespace std;

map<int,int>mp,used;

int w,h,n;
void add(int x,int y,int i){
  if(x == 0) mp[y] = i;
  else if(y == h) mp[h+x] = i;
  else if(x == w) mp[h+w+h-y] = i;
  else if(y == 0) mp[2*h + w + w - x] = i;
}

typedef pair<int,int> P;
bool check(){
 stack <int> S;
 
 for(P a:mp) {
   int num = a.second;
   if(num == -1) continue;
   if(used[num] == 1 && S.top() != num) return 0;
   if(used[num] == 1) S.pop(),used[num] = 0;
   else S.push(num),used[num] = 1;
 }

 for(P a:mp) {
   int num = a.second;
   if(num == -1) continue;
   if(used[num] == 1 && S.top() != num) return 0;
   if(used[num] == 1) S.pop(),used[num] = 0;
   else S.push(num),used[num] = 1;
 }
 
 return 1;
}

int main(){
  cin>>w>>h>>n;
  memset(mp,-1,sizeof(mp));
  for(int i=0;i<n;i++){
    int x1,y1,x2,y2;

    cin>>x1>>y1>>x2>>y2;
    if(!((x1 == 0 || y1 == 0 ||x1 == w || y1 == w) &&
         (x2 == 0 || y2 == 0 ||x2 == w || y2 == w)))continue;
    add(x1,y1,i);
    add(x2,y2,i);
  }
  
  cout<<(check()? "YES":"NO")<<endl; 
    
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:10: error: cannot convert 'std::map<int, int>' to 'void*'
   41 |   memset(mp,-1,sizeof(mp));
      |          ^~
      |          |
      |          std::map<int, int>
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~