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

#include <stdlib.h>
#include <string.h>

const int maxn = 500 + 5;
int mp[maxn][maxn], vis[maxn];
int match[maxn]; //表示match[1]=2表示女1和男2约上了(不一定最后是在一起的)
int n;
struct node {
	int a, b;
} p[105], q[105];
int Find(int x) //这里x表示男生
		{
	for (int i = 1; i <= n; i++) //这里的i表示女生
		if (!vis[i] && mp[i][x]) //如果这个女生没有询问过而且你和这个男生认识
				{
			vis[i] = 1; //标记询问过了
			if (match[i] == -1 || Find(match[i])) //如果当前男孩纸是来直接找约会对象，或者是要抛弃当前女孩去找下一个女孩的(而且找到了)
					{
				match[i] = x; //当前男生和女生约上了(x男i女)
				return 1; //返回找到了~~~
			}
		}
	return 0;
}

int TwoDPlane2NPoints(void) {
	std::cin >> n;
	memset(mp, 0, sizeof(mp));
	memset(match, -1, sizeof(match));
	for (int i = 1; i <= n; i++)
		std::cin >> p[i].a >> p[i].b;
	for (int i = 1; i <= n; i++)
		std::cin >> q[i].a >> q[i].b;
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (p[i].a < q[j].a && p[i].b < q[j].b)
				mp[i][j] = 1;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		memset(vis, 0, sizeof(vis));
		if (Find(i))
			ans++;
	}
	std::cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int TwoDPlane2NPoints()':
a.cc:27:14: error: 'cin' is not a member of 'std'
   27 |         std::cin >> n;
      |              ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <string.h>
  +++ |+#include <iostream>
    3 | 
a.cc:31:22: error: 'cin' is not a member of 'std'
   31 |                 std::cin >> p[i].a >> p[i].b;
      |                      ^~~
a.cc:31:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:22: error: 'cin' is not a member of 'std'
   33 |                 std::cin >> q[i].a >> q[i].b;
      |                      ^~~
a.cc:33:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:14: error: 'cout' is not a member of 'std'
   44 |         std::cout << ans;
      |              ^~~~
a.cc:44:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <stdlib.h>
#include <string.h>
using namespace std;
const int maxn = 500 + 5;
int mp[maxn][maxn], vis[maxn];
int match[maxn]; //表示match[1]=2表示女1和男2约上了(不一定最后是在一起的)
int n;
struct node {
	int a, b;
} p[105], q[105];
int Find(int x) //这里x表示男生
		{
	for (int i = 1; i <= n; i++) //这里的i表示女生
		if (!vis[i] && mp[i][x]) //如果这个女生没有询问过而且你和这个男生认识
				{
			vis[i] = 1; //标记询问过了
			if (match[i] == -1 || Find(match[i])) //如果当前男孩纸是来直接找约会对象，或者是要抛弃当前女孩去找下一个女孩的(而且找到了)
					{
				match[i] = x; //当前男生和女生约上了(x男i女)
				return 1; //返回找到了~~~
			}
		}
	return 0;
}

int main(void) {
	scanf("%d", &n);
	memset(mp, 0, sizeof(mp));
	memset(match, -1, sizeof(match));
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &p[i].a, &p[i].b);
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &q[i].a, &q[i].b);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (p[i].a < q[j].a && p[i].b < q[j].b)
				mp[i][j] = 1;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		memset(vis, 0, sizeof(vis));
		if (Find(i))
			ans++;
	}
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'scanf' was not declared in this scope
   27 |         scanf("%d", &n);
      |         ^~~~~
a.cc:44:9: error: 'printf' was not declared in this scope
   44 |         printf("%d\n", ans);
      |         ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <string.h>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

#include <stdlib.h>
#include <stdio.h>
using namespace std;
const int maxn = 500 + 5;
int mp[maxn][maxn], vis[maxn];
int match[maxn]; //表示match[1]=2表示女1和男2约上了(不一定最后是在一起的)
int n;
struct node {
	int a, b;
} p[105], q[105];
int Find(int x) //这里x表示男生
		{
	for (int i = 1; i <= n; i++) //这里的i表示女生
		if (!vis[i] && mp[i][x]) //如果这个女生没有询问过而且你和这个男生认识
				{
			vis[i] = 1; //标记询问过了
			if (match[i] == -1 || Find(match[i])) //如果当前男孩纸是来直接找约会对象，或者是要抛弃当前女孩去找下一个女孩的(而且找到了)
					{
				match[i] = x; //当前男生和女生约上了(x男i女)
				return 1; //返回找到了~~~
			}
		}
	return 0;
}

int main(void) {
	scanf("%d", &n);
	memset(mp, 0, sizeof(mp));
	memset(match, -1, sizeof(match));
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &p[i].a, &p[i].b);
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &q[i].a, &q[i].b);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (p[i].a < q[j].a && p[i].b < q[j].b)
				mp[i][j] = 1;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		memset(vis, 0, sizeof(vis));
		if (Find(i))
			ans++;
	}
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'memset' was not declared in this scope
   28 |         memset(mp, 0, sizeof(mp));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <stdio.h>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <stdlib.h>
using namespace std;
const int maxn = 500 + 5;
int mp[maxn][maxn], vis[maxn];
int match[maxn]; //表示match[1]=2表示女1和男2约上了(不一定最后是在一起的)
int n;
struct node {
	int a, b;
} p[105], q[105];
int Find(int x) //这里x表示男生
		{
	for (int i = 1; i <= n; i++) //这里的i表示女生
		if (!vis[i] && mp[i][x]) //如果这个女生没有询问过而且你和这个男生认识
				{
			vis[i] = 1; //标记询问过了
			if (match[i] == -1 || Find(match[i])) //如果当前男孩纸是来直接找约会对象，或者是要抛弃当前女孩去找下一个女孩的(而且找到了)
					{
				match[i] = x; //当前男生和女生约上了(x男i女)
				return 1; //返回找到了~~~
			}
		}
	return 0;
}

int main(void) {
	scanf("%d", &n);
	memset(mp, 0, sizeof(mp));
	memset(match, -1, sizeof(match));
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &p[i].a, &p[i].b);
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &q[i].a, &q[i].b);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (p[i].a < q[j].a && p[i].b < q[j].b)
				mp[i][j] = 1;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		memset(vis, 0, sizeof(vis));
		if (Find(i))
			ans++;
	}
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'scanf' was not declared in this scope
   26 |         scanf("%d", &n);
      |         ^~~~~
a.cc:27:9: error: 'memset' was not declared in this scope
   27 |         memset(mp, 0, sizeof(mp));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdlib.h>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:43:9: error: 'printf' was not declared in this scope
   43 |         printf("%d\n", ans);
      |         ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include <stdlib.h>
  +++ |+#include <cstdio>
    2 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	pair<int,int> R[N];
	for (int i = 0; i < N; i++) {
		cin >> R[i].first >> R[i].second;
	}
	pair<int,int> B[N];
	for (int i = 0; i < N; i++) {
		cin >> B[i].first >> B[i].second;
	}
	int ans = 0;
	sort(B.first, B.first + N);
	sort(R.second, R.second + N, greater<int>());
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (R[j].first < B[i].first&&R[j].second < B[i].second) {
				ans++;
				R[j].first = 10000;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: request for member 'first' in 'B', which is of non-class type 'std::pair<int, int> [N]'
   15 |         sort(B.first, B.first + N);
      |                ^~~~~
a.cc:15:25: error: request for member 'first' in 'B', which is of non-class type 'std::pair<int, int> [N]'
   15 |         sort(B.first, B.first + N);
      |                         ^~~~~
a.cc:16:16: error: request for member 'second' in 'R', which is of non-class type 'std::pair<int, int> [N]'
   16 |         sort(R.second, R.second + N, greater<int>());
      |                ^~~~~~
a.cc:16:26: error: request for member 'second' in 'R', which is of non-class type 'std::pair<int, int> [N]'
   16 |         sort(R.second, R.second + N, greater<int>());
      |                          ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	pair<int><int> R[N];
	for (int i = 0; i < N; i++) {
		cin >> R[i].first >> R[i].second;
	}
	pair<int><int> B[N];
	for (int i = 0; i < N; i++) {
		cin >> B[i].first >> B[i].second;
	}
	int ans = 0;
	sort(B.first, B.first + N);
	sort(A.second, A.second + N, greater<int>());
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (A[j].first < B[i].first&&A[j].second < B[i].second) {
				ans++;
				A[j].first = 10000;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: wrong number of template arguments (1, should be 2)
    6 |         pair<int><int> R[N];
      |                 ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:6:18: error: expected unqualified-id before '<' token
    6 |         pair<int><int> R[N];
      |                  ^
a.cc:8:24: error: 'R' was not declared in this scope
    8 |                 cin >> R[i].first >> R[i].second;
      |                        ^
a.cc:10:17: error: wrong number of template arguments (1, should be 2)
   10 |         pair<int><int> B[N];
      |                 ^
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:10:18: error: expected unqualified-id before '<' token
   10 |         pair<int><int> B[N];
      |                  ^
a.cc:12:24: error: 'B' was not declared in this scope
   12 |                 cin >> B[i].first >> B[i].second;
      |                        ^
a.cc:15:14: error: 'B' was not declared in this scope
   15 |         sort(B.first, B.first + N);
      |              ^
a.cc:16:14: error: 'A' was not declared in this scope
   16 |         sort(A.second, A.second + N, greater<int>());
      |              ^
Language: C++

#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;

// Ford-Fulkerson
int INF = 100000;
struct edge { int to, cap, rev; };

vector<edge> G[202];
bool used[202];

void add_edge(int from, int to, int cap) {
   G[from].push_back((edge){to, cap, G[to].size()});
   G[to].push_back((edge){from, 0, G[from].size() - 1});
}

int dfs(int v, int t, int f) {
   if (v == t) return f;

   used[v] = true;
   for (int i = 0; i < G[v].size(); i++) {
      edge &e = G[v][i];
      if (!used[e.to] && e.cap > 0) {
         int d = dfs(e.to, t, min(f, e.cap));
         if (d > 0) {
            e.cap -= d;
            G[e.to][e.rev].cap += d;
            return d;
         }
      }
   }
   return 0;
}

int max_flow(int s, int t) {
   int flow = 0;
   for (;;) {
      memset(used, 0, sizeof(used));
      int f = dfs(s, t, INF);
      if (f == 0) return flow;
      flow += f;
   }
}

int main() {
   int N;
   cin >> N;
   int Rx[N], Ry[N], Bx[N], By[N];
   for (int i = 0; i < N; i++) {
      cin >> Rx[i] >> Ry[i];
   }
   for (int i = 0; i < N; i++) {
      cin >> Bx[i] >> By[i];
   }
   int s = 2 * N;
   int t = s + 1;
   for (int i = 0; i < N; i++) {
      add_edge(s, i, 1);
      add_edge(i + N, t, 1);
   }
   for (int r = 0; r < N; r++) {
      for (int b = 0; b < N; b++) {
         if (Rx[r] < Bx[b] && Ry[r] < By[b]) {
            add_edge(r, b + N, 1);
         }
      }
   }
   cout << max_flow(s, t) << endl;
   return 0;
}


Compiler output:
a.cc: In function 'void add_edge(int, int, int)':
a.cc:18:48: warning: narrowing conversion of 'G[to].std::vector<edge>::size()' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   18 |    G[from].push_back((edge){to, cap, G[to].size()});
      |                                      ~~~~~~~~~~^~
a.cc:19:51: warning: narrowing conversion of '(G[from].std::vector<edge>::size() - 1)' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   19 |    G[to].push_back((edge){from, 0, G[from].size() - 1});
      |                                    ~~~~~~~~~~~~~~~^~~
a.cc: In function 'int max_flow(int, int)':
a.cc:43:7: error: 'memset' was not declared in this scope
   43 |       memset(used, 0, sizeof(used));
      |       ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<vector>
  +++ |+#include <cstring>
    7 |
Language: C++

#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
#include <map>
using namespace std;
using ll = long long;
//typedef pair<string,string> P;
//double dat[100][100];
//int dp[6][1010];//動的計画法
//int prime[100001];
//char str[1010][1010];
//vector<pair<int,int> > pc[100001];
//int ABS(int a){return max(a,-a);}
int main(){
	int n,ans;
	cin>>n;
	vector<pair<int,int>> s(n),t(n);
	for(int i=0;i<n;i++){
		cin>>s[i].second>>s[i].first;
	}
	for(int i=0;i<n;i++){
		cin>>t[i].first>>t[i].second;
	}
	sort(s.begin(),s.end());
	sort(t.begin(),t.end());
	reverse(s.begin(),s.end());
	map<int,bool> c;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(c[j]) continue;
			if(s[j].first<t[i].second&&s[j].second<b[i].first){
				ans++;
				c[j]=true;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:64: error: 'b' was not declared in this scope
   38 |                         if(s[j].first<t[i].second&&s[j].second<b[i].first){
      |                                                                ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include "UnionFind.h"
typedef long long i64;
typedef long long ll;

#define MAX_V 100
#define MAX_E MAX_V - 1
#define pii pair<int,int>
using namespace std;

int cost[MAX_V][MAX_V];
struct point {
	int x, y;

};
bool comp(const point &left, const point &right) {
	int leftMin = min(left.x, left.y);
	int rightMin = min(right.x, right.y);
	return leftMin < rightMin;
}
void twoDPlanTowNPoints() {
	int N;
	cin >> N;
	point ab[101];
	point cd[101];
	for (size_t i = 0; i < N; i++)
	{
		int a, b;
		cin >> a >> b;
		ab[i].x = -a;
		ab[i].y = -b;
	}
	for (size_t i = 0; i < N; i++)
	{
		int c, d;
		cin >> c >> d;
		cd[i].x = c;
		cd[i].y = d;
	}
	sort(ab, ab + N, comp);
	sort(cd, cd + N, comp);
	int res = 0;
	bool use[101];
	fill(use, use + N, false);
	for (size_t i = 0; i < N; i++)
	{
		//int best = 300;
		//int besti = -1;
		for (int j = 0; j < N; j++)
		{
			point p = ab[j];
			p.x = -p.x;
			p.y = -p.y;
			if (!use[j] && p.x < cd[i].x && p.y < cd[i].y) {
				use[j] = true;
				res++;
				break;
				//int tm = min(best, min((cd[i].x - p.x), (cd[i].y - p.y)));
				//if (best > tm) {
				//	best = tm;
				//	besti = j;
				//}
			}
		}
		//if (besti != -1) {
		//	res++;
		//	use[besti] = true;
		//}
	}
	cout << res << endl;
}
int main() {
	twoDPlanTowNPoints();
	return 0;
}

Compiler output:
a.cc:16:10: fatal error: UnionFind.h: No such file or directory
   16 | #include "UnionFind.h"
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.awt.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

import static java.lang.Integer.parseInt;

public class Main {

  final int MIN = -1_000_000_000;
  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      int n = parseInt(in.readLine());

      pxPoint[] reds  = new pxPoint[n];
      pxPoint[] blues = new pxPoint[n];
      String[] lines;
      for(int i=0, x=0, y=0; i<n; i++) {
        lines = in.readLine().split(" ");
        x = parseInt(lines[0]);
        y = parseInt(lines[1]);
        reds[i] = new pxPoint(x, y); 
      }
      for(int i=0, x=0, y=0; i<n; i++) {
        lines = in.readLine().split(" ");
        x = parseInt(lines[0]);
        y = parseInt(lines[1]);
        blues[i] = new pxPoint(x, y); 
      }

      Arrays.parallelSort(reds);
      Arrays.parallelSort(blues);

      boolean[] isDone = new boolean[n];

      int ans = 0;
      pxPoint p = new pxPoint(MIN,Min);
      int maxJ = Min;
      for(int i=0; i<n; i++) {
        for(int j=0; j<n; j++) {
          if(!isDone[j] && reds[j].x < blues[i].x) {
            if(reds[j].y >= p.y) {
              p.x = reds[j].x;
              p.y = reds[j].y;
              maxJ = j;
            }
          }
        }
        if(maxJ != -1) {
          ans++;
          isDone[maxJ] = true;
          p.x = MIN; p.y = MIN; maxJ = MIN;
        }
      }

      System.out.println(ans);
      // for (pxPoint p : reds) {
      //   System.out.println(p.x + " " + p.y);
      // }
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }

  class pxPoint extends Point implements Comparable<pxPoint> {

    public pxPoint() {
      super();
    }
    public pxPoint(int x, int y) {
      super(x, y);
    }

    // @Override
    public int compareTo(pxPoint obj) {
      if(this.x == obj.x) return 0;
      return this.x > obj.x ? 1 : -1;
    }
  }
}

Compiler output:
Main.java:44: error: cannot find symbol
      pxPoint p = new pxPoint(MIN,Min);
                                  ^
  symbol:   variable Min
  location: class Main
Main.java:45: error: cannot find symbol
      int maxJ = Min;
                 ^
  symbol:   variable Min
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxx = 1e5 + 7;
const int Inf = 1 << 30;
int n, ans;
map <int, bool> vis;

struct PP {
	int x, y;
} p[107], q[107];

bool cmp(PP a, PP b) { return a.x < b.x; }

int main() {
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> p[i].x >> p[i].y;
	for(int i = 1; i <= n; i++) cin >> q[i].x >> q[i].y;
	sort(p + 1, p + n + 1, cmp);
	sort(q + 1, q + n + 1, cmp);
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= n; j++) {
			if(q[j].x > p[i].x !vis[j]) {
				if(q[j].y > p[i].y) {
					vis[j] = 1;
					ans++;
					break;
				}
			}
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:43: error: expected ')' before '!' token
   23 |                         if(q[j].x > p[i].x !vis[j]) {
      |                           ~               ^~
      |                                           )
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> // accumulate
#include <queue>
#include <string>
#include <cmath> // sqrt
using namespace std;
typedef long long ll;


const int MAX_V = 210;
const int INF = 1e9;

struct edge {
    int to, cap, rev;
};

vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from, int to, int cap) {
    G[from].push_back((edge){to, cap, G[to].size()});
    G[to].push_back((edge){from, 0, G[from].size() - 1});
}

int dfs(int v, int t, int f) {
    if (v == t) return f;
    used[v] = true;
    for (int i = 0; i < G[v].size(); i++) {
        edge &e = G[v][i];
        if (!used[e.to] && e.cap > 0) {
            int d = dfs(e.to, t, min(f, e.cap));
            if (d > 0) {
                e.cap -= d;
                G[e.to][e.rev].cap += d;
                return d;
            }
        }
    }
    return 0;
}

int max_flow(int s, int t) {
    int flow = 0;
    for (;;) {
        memset(used, 0, sizeof(used));
        int f = dfs(s, t, INF);
        if (f == 0) return flow;
        flow += f;
    }
}

int main() {
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n), d(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i] >> d[i];
    }

    int start = 0;
    int goal = 2*n+1;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (a[i] < c[j] and b[i] < d[j]) {
                add_edge(i+1, n+j+1, 1);
            }
        }
    }

    for (int i = 0; i < n; i++) {
        add_edge(0, i+1, 1);
        add_edge(n+i+1, 2*n+1, 1);
    }

    cout << max_flow(start, goal) << endl;

    return 0;
}

Compiler output:
a.cc: In function 'void add_edge(int, int, int)':
a.cc:23:49: warning: narrowing conversion of 'G[to].std::vector<edge>::size()' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   23 |     G[from].push_back((edge){to, cap, G[to].size()});
      |                                       ~~~~~~~~~~^~
a.cc:24:52: warning: narrowing conversion of '(G[from].std::vector<edge>::size() - 1)' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   24 |     G[to].push_back((edge){from, 0, G[from].size() - 1});
      |                                     ~~~~~~~~~~~~~~~^~~
a.cc: In function 'int max_flow(int, int)':
a.cc:47:9: error: 'memset' was not declared in this scope
   47 |         memset(used, 0, sizeof(used));
      |         ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <cmath> // sqrt
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> // accumulate
#include <queue>
#include <string>
#include <cmath> // sqrt
using namespace std;
typedef long long ll;


const int MAX_V = 210;
const int INF = 1e9;

struct edge {
    int to, cap, rev;
};

vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from, int to, int cap) {
    G[from].push_back((edge){to, cap, G[to].size()});
    G[to].push_back((edge){from, 0, G[from].size() - 1});
}

int dfs(int v, int t, int f) {
    if (v == t) return f;
    used[v] = true;
    for (int i = 0; i < G[v].size(); i++) {
        edge &e = G[v][i];
        if (!used[e.to] && e.cap > 0) {
            int d = dfs(e.to, t, min(f, e.cap));
            if (d > 0) {
                e.cap -= d;
                G[e.to][e.rev].cap += d;
                return d;
            }
        }
    }
    return 0;
}

int max_flow(int s, int t) {
    int flow = 0;
    for (;;) {
        memset(used, 0, sizeof(used));
        int f = dfs(s, t, INF);
        if (f == 0) return flow;
        flow += f;
    }
}

int main() {
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n), d(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i] >> d[i];
    }

    int start = 0;
    int goal = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (a[i] < c[j] and b[i] < d[j]) {
                add_edge(i+1, n+j+1, 1);
            }
        }
    }

    for (int i = 0; i < n; i++) {
        add_edge(0, i+1, 1);
        add_edge(n+i+1, 2*n+1, 1);
    }

    cout << max_flow(start, goal) << endl;

    return 0;
}

Compiler output:
a.cc: In function 'void add_edge(int, int, int)':
a.cc:23:49: warning: narrowing conversion of 'G[to].std::vector<edge>::size()' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   23 |     G[from].push_back((edge){to, cap, G[to].size()});
      |                                       ~~~~~~~~~~^~
a.cc:24:52: warning: narrowing conversion of '(G[from].std::vector<edge>::size() - 1)' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   24 |     G[to].push_back((edge){from, 0, G[from].size() - 1});
      |                                     ~~~~~~~~~~~~~~~^~~
a.cc: In function 'int max_flow(int, int)':
a.cc:47:9: error: 'memset' was not declared in this scope
   47 |         memset(used, 0, sizeof(used));
      |         ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <cmath> // sqrt
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

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

int main(){
	int n;
  cin >> n;
  int a, b;
  vector<pair<int,int>> red(n), blue(n);
  for(auto con: red)
  {
    cin >> a >> b ;
    con = make_pair(a,b);
  }
  sort(red.begin(), red.end());
  
  int c,d;
  int counter = 0;
  for(auto con: blue)
  {
    cin >> c >> d;
    con = make_pair(c,d);
  }
  sort(blue.begin(), blue.end());
  
  int i,j = 0;
  while(i<n &&j <n){
    if(blue[j].first > red[i].first){
      if (blue[j].second > red[i].second){
        counter++;
        j++;
        i++;
      }
      else{
        j++
      }
    }
    else{
      ++j;
    }
  }
  
  cout << counter << endl;
      
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: expected ';' before '}' token
   34 |         j++
      |            ^
      |            ;
   35 |       }
      |       ~
Language: C++

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

int main(){
	int n;
  cin >> n;
  int a, b;
  vector<pair<int,int>> red(n);
  for(auto con: red)
  {
    cin >> a >> b ;
    con = make_pair(a,b);
  }
  int c,d;
  int counter =0;
  for(auto con: red)
  {
    cin >> c >> d;
    if ((c>con->first) && (d > con->second))
      ++counter;
  }
  
  cout << counter << endl;
      
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: base operand of '->' has non-pointer type 'std::pair<int, int>'
   19 |     if ((c>con->first) && (d > con->second))
      |               ^~
a.cc:19:35: error: base operand of '->' has non-pointer type 'std::pair<int, int>'
   19 |     if ((c>con->first) && (d > con->second))
      |                                   ^~
Language: C++

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

int main(){
	int n;
  cin >> n;
  int a, b
  vector<pair<int,int>> red(n);
  for(auto con: red)
  {
    cin >> a >> b ;
    con = make_pair(a,b);
  }
  int c,d;
  int counter =0;
  for(auto con: red)
  {
    cin >> c >> d;
    if ((c>con->first) && (d > con->second))
      ++counter;
  }
  
  cout << counter << endl;
      
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'vector'
    8 |   vector<pair<int,int>> red(n);
      |   ^~~~~~
a.cc:9:17: error: 'red' was not declared in this scope; did you mean 'read'?
    9 |   for(auto con: red)
      |                 ^~~
      |                 read
a.cc:11:17: error: 'b' was not declared in this scope
   11 |     cin >> a >> b ;
      |                 ^
a.cc:16:17: error: 'red' was not declared in this scope; did you mean 'read'?
   16 |   for(auto con: red)
      |                 ^~~
      |                 read
Language: C++

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

int main(){
	int n;
  cin >> n;
  vector<pair<int,int>> red(n);
  for(auto con: red)
  {
    cin >> con->first >> con->second ;
  }
  int c,d;
  int counter =0;
  for(auto con: red)
  {
    cin >> c >> d;
    if ((c>con->first) && (d > con->second))
      ++counter;
  }
  
  cout << counter << endl;
      
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: base operand of '->' has non-pointer type 'std::pair<int, int>'
   10 |     cin >> con->first >> con->second ;
      |               ^~
a.cc:10:29: error: base operand of '->' has non-pointer type 'std::pair<int, int>'
   10 |     cin >> con->first >> con->second ;
      |                             ^~
a.cc:17:15: error: base operand of '->' has non-pointer type 'std::pair<int, int>'
   17 |     if ((c>con->first) && (d > con->second))
      |               ^~
a.cc:17:35: error: base operand of '->' has non-pointer type 'std::pair<int, int>'
   17 |     if ((c>con->first) && (d > con->second))
      |                                   ^~
Language: Java

Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        int[] b = new int[n];
        int[] c=new int[n];
       int[] used=new int[n];
      int ans=0;
       HashMap<Integer,Integer> map1=new HashMap<Integer,Integer>();
       HashMap<Integer,Integer> map2=new HashMap<Integer,Integer>();
       for(int i=0;i<n;i++){
         int a = in.nextInt();
         b[i]=in.nextInt();
        map1.put(b[i],a);
      }
 for(int i=0;i<n;i++){
       c[i]=in.nextInt();
         int d = in.nextInt();
        map2.put(c[i],d);
      }
     Arrays.sort(b);
     Arrays.sort(c);
    for(int i=0; i<n;i++){
      for(int j=n-1;j>=0;j--){
         if(c[i]>map1.get(b[j]) && map2.get(c[i])>b[j]&&used[j]==0){
          ans++;
          used[j]=1;
           break;
       }
     }
}
 System.out.println(ans);
    }}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
Scanner in = new Scanner(System.in);
^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
       for(int i=0;i<n;i++){
       ^
Main.java:9: error: class, interface, enum, or record expected
       for(int i=0;i<n;i++){
                   ^
Main.java:9: error: class, interface, enum, or record expected
       for(int i=0;i<n;i++){
                       ^
Main.java:11: error: class, interface, enum, or record expected
         b[i]=in.nextInt();
         ^
Main.java:12: error: class, interface, enum, or record expected
        map1.put(b[i],a);
        ^
Main.java:13: error: class, interface, enum, or record expected
      }
      ^
Main.java:14: error: class, interface, enum, or record expected
 for(int i=0;i<n;i++){
             ^
Main.java:14: error: class, interface, enum, or record expected
 for(int i=0;i<n;i++){
                 ^
Main.java:17: error: class, interface, enum, or record expected
        map2.put(c[i],d);
        ^
Main.java:18: error: class, interface, enum, or record expected
      }
      ^
Main.java:20: error: class, interface, enum, or record expected
     Arrays.sort(c);
     ^
Main.java:21: error: class, interface, enum, or record expected
    for(int i=0; i<n;i++){
    ^
Main.java:21: error: class, interface, enum, or record expected
    for(int i=0; i<n;i++){
                 ^
Main.java:21: error: class, interface, enum, or record expected
    for(int i=0; i<n;i++){
                     ^
Main.java:22: error: class, interface, enum, or record expected
      for(int j=n-1;j>=0;j--){
                    ^
Main.java:22: error: class, interface, enum, or record expected
      for(int j=n-1;j>=0;j--){
                         ^
Main.java:25: error: class, interface, enum, or record expected
          used[j]=1;
          ^
Main.java:26: error: class, interface, enum, or record expected
           break;
           ^
Main.java:27: error: class, interface, enum, or record expected
       }
       ^
Main.java:31: error: class, interface, enum, or record expected
    }}
    ^
21 errors
Language: C++

#include <bits\stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
bool f[110];
int main(){
  ll n;
  cin>>n;
  P a[110],b[110];
  for(int i=0;i<n;i++)cin>>a[i].first>>a[i].second;
  for(int i=0;i<n;i++)cin>>b[i].first>>b[i].second;
  sort(a,a+n);
  sort(b,b+n);
  ll ans=0;
  for(int i=0;i<n;i++){
    P num,yan;
    num=make_pair(-1,-1);
    yan=num;
    for(int j=0;j<n;j++){
      if(f[j])continue;
      if(a[j].first<b[i].first&&a[j].second<b[i].second){
        if(num.second<a[j].second){
          num.second=a[j].second;
          num.first=j;
        }
      }
    }
    if(num!=yan){
      ans++;
      f[num.first]=1;
    }
  }
  cout<<ans<<endl;
  return 0;
}

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

#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<limits.h>
using namespace std;
#define INF LLONG_MAX
#define inf INT_MAX
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
typedef pair<int, int> P;
ll GCD(ll a, ll b) {
	if (b == 0)return a;
	return GCD(b, a%b);
}
ll LCM(ll a, ll b) {
	return a / GCD(a, b)*b;
}
ll mypow(ll a, ll b) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1)*a;
	else return mypow(a, b / 2)*mypow(a, b / 2) ;
}
/*
//Conbination!
ll c[51][51];
void comb(int n) {
	rep(i, 51) {
		rep(j, i + 1) {
			if (j == 0 || j == i)c[i][j] = 1;
			else c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
		}
	}
}
*/
int n, a[110], b[110], c[110], d[110];
vector<int> vec[210];
int match[210];
bool used[210];
void add_edge(int u, int v) {
	vec[u].push_back(v);
	vec[v].push_back(u);
}
bool dfs(int v) {
	used[v] = true;
	for (int i = 0; i < vec[v].size(); i++) {
		int u = vec[v][i];
		int w = match[u];
		if (w < 0 || !used[w] && dfs(w)) {
			match[v] = u;
			match[u] = v;
			return true;
		}
	}
	return false;
}
int bipartite_batching() {
	int res = 0;
	memset(match, -1, sizeof(match));
	for (int v = 0; v < 2 * n; v++) {
		if (match[v] < 0) {
			memset(used, 0, sizeof(used));
			if (dfs(v))res++;
		}
	}
	return res;
}
int main() {
	cin >> n;
	rep(i, n)cin >> a[i] >> b[i];
	rep(i, n)cin >> c[i] >> d[i];
	rep(i, n) {
		rep(j, n) {
			if (a[i] < c[j] && b[i] < d[j])add_edge(i, j + n);
		}
	}
	cout << bipartite_batching() << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int bipartite_batching()':
a.cc:63:9: error: 'memset' was not declared in this scope
   63 |         memset(match, -1, sizeof(match));
      |         ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include<limits.h>
  +++ |+#include <cstring>
   10 | using namespace std;
Language: C++

#include <bits/stdc++.h>
    
#define int long long
    
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define FORR(i,m,n) for(int i=m;i>=n;i--)
#define pb(x) push_back(x) 
#define SORT(x) sort((x).begin(),(x).end())
#define INF 99999999999
    
using namespace std;
    
int dy[4]={1, -1, 0, 0};
int dx[4]={0, 0, 1, -1};

int32_t main(){
    int n;
    cin >> n;
    vector<pair<int, int> > r(n), b(n);
    REP(i, n){
        int c, d;
        cin >> c >> d;
        r[i] = make_pair(c, d);
    }
    REP(i, n){
        int c, d;
        cin >> c >> d;
        b[i] = make_pair(c, d);
    }

    SORT(r); SORT(b);

    int cnt=0;
    set<int> s;
    REP(i, n){
        int m=-1, u;
        REP(j, n){
            .if(r[j].first>b[i].first) break;
            if(b[i].second<=r[j].second) continue;
            if(m<r[j].second && s.find(j)==s.end()){
                m = r[j].second;
                u = j;
            }
        }
        if(m!=-1){
            cnt++;
            s.insert(u);
        }
    }

    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:39:13: error: expected primary-expression before '.' token
   39 |             .if(r[j].first>b[i].first) break;
      |             ^
a.cc:39:14: error: expected unqualified-id before 'if'
   39 |             .if(r[j].first>b[i].first) break;
      |              ^~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int mian() {
	int n;
	cin >> n;
	vector<pair<int, int>> red(n);
	vector<pair<int, int>> blue(n);
	int u, v;
	int i;
	for (i = 0; i < n; i++) {
		cin >> u >> v;
		red.push_back(make_pair(u, v));
	}

	for (i = 0; i < n; i++) {
		cin >> u >> v;
		blue.push_back(make_pair(u, v));
	}

	sort(red.begin(), red.end());
	sort(blue.begin(), blue.end());

	int k;
	int ret = 0;
	for (i = n - 1; i >= 0; i--) {
		for (k = 0; k < n; k++) {
			if (red[i].first < blue[i].first && red[i].second < blue[i].second) {
				ret++;
				blue[k].first = 0;
				blue[k].second = 0;
			}
		}
	}
	cout << ret << endl;
	return 0;
	
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class _2DPlane2NPoints {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        List<int[]> redList = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            int nums[] = {x + y, x, y};
            redList.add(nums);
        }

        List<int[]> blueList = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            int nums[] = {x + y, x, y};
            blueList.add(nums);
        }

        redList.sort((o1, o2) -> (o2[0]) - (o1[0]));
        blueList.sort((o1, o2) -> (o2[0]) - (o1[0]));

        int p = 0;
        int score = 0;
        for (int[] blues: blueList){
            while(true){
                if(p >= redList.size()){
                    break;
                }
                int[] reds = redList.get(p);
                System.out.println("b" + blues[0] + "r" + reds[0]);

                if(blues[0] >= reds[0]){
                    System.out.println("b" + blues[1] + "b" + blues[2] + "r" + reds[1] + "r" + reds[2]);
                    if(blues[1] > reds[1] && blues[2] > reds[2]){
                        score++;
                        System.out.println("p");
                        redList.remove(p);
                        p = 0;
                        break;
                    }
                }
                p++;
            }
        }
        System.out.println(score);
    }
}

//    List<int[]> blueList = new ArrayList<>();
//        for (int i = 0; i < n; i++) {
//        int nums[] = {sc.nextInt(), sc.nextInt()};
//        blueList.add(nums);
//        }
//
//        for (int[] nums : redList){
//        System.out.println(nums[0] + "," + nums[1]);
//        }
//        System.out.println("\n");
//
//        redList.sort(Comparator.comparingInt(o -> o[0]));
//        redList.sort(Comparator.comparingInt(o -> o[1]));
//
//        for (int[] nums : redList){
//        System.out.println(nums[0] + "," + nums[1]);
//        }


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

#include <iostream>
#include <cstdio>
#include <queue>
#include <cmath>
#include <random>
#include <fstream>

#define REP(i, N) for(int i = 0; i< N; i++)
using namespace std;
#define ll long long

class Leftdaishou{
public:
    bool operator()(const pair<int, int>& riLeft, const pair<int, int>& riRight) const {
        return min(riLeft.first,riLeft.second) < (riRight.first , riRight.second); // ここでは、元の < の意味に合わせてあるが、異なる判断も可能。
    }
};

int main(){
    int N;
    cin >> N;
    vector <pair<int,int>> ab;
    vector <pair<int,int>> cd;
    int a,b,c,d;
    
    REP(i, N){
        cin >> a >> b;
        ab.push_back({a,b});
    }
    REP(i, N){
        cin >> c >> d;
        cd.push_back({c,d});
    }
    sort(ab.begin(),ab.end(),Leftdaishou());
    sort(cd.begin(),cd.end(),Leftdaishou());
    REP(i, N){
    //    printf("(%d,%d),(%d,%d)\n",ab[i].first , ab[i].second , cd[i].first ,cd[i].second);
    }
    int pairninatta = 0;
    bool matchsita = false;
    bool mada[100] = {false};
    REP(i, N){
        REP(j, N){
            matchsita = false;
            //printf("(%d,%d),(%d,%d)\n",ab[i].first , ab[i].second , cd[j].first ,cd[j].second);
            if(ab[i].first < cd[j].first && ab[i].second < cd[j].second && mada[j] == false){
                //printf("A");
    //            printf("(%d,%d),(%d,%d)\n",ab[i].first , ab[i].second , cd[j].first ,cd[j].second);
                mada[j] = true;
                matchsita = true;
                pairninatta++;
                break;
            }
        }
    }
    cout << pairninatta;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   34 |     sort(ab.begin(),ab.end(),Leftdaishou());
      |     ^~~~
      |     sqrt
Language: C++

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

int main() {
  int n; cin >> n;
  vector<pair<int, int> > r(n);
  for (int i = 0; i < n; i++) {
    int x, y; cin >> x >> y;
    r.at(i) = make_pair(x, y);
  }
  vector<pair<int, int> > b(n);
  for (int i = 0; i < n; i++) {
    int x, y; cin >> x >> y;
    b.at(i) = make_pair(x, y);
  }

  sort(b.begin(), b.end());
  int ans = 0;

  for (int i = 0; i < n; i++) {
    vector<pair<int, int>> tmp;
    for (int j = 0; j < r.size(); j++) {
      if (b.at(i).first > r.at(j).first && b.at(i).second > r.at(j).second) {
        tmp.emplace_back(r.at(j).second, j);
      }
    }

  //   if (!tmp.empty()) {
  //     auto max = *max_element(tmp.begin(), tmp.end());
  //     r.erase(r.begin() + max.second);
  //     ans++;
  //   }
  // }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<pair<int, int>>red;
	vector<pair<int, int>>blue;
	for (int i = 0;i < n;i++) {
		int a, b;
		cin >> a >> b;
		pair<int, int>p = make_pair(a, b);
		red.push_back(p);
	}
	sort(red.begin(), red.end());
	for (int i = 0;i < n;i++) {
		int a, b;
		cin >> a >> b;
		pair<int, int>p = make_pair(a, b);
		blue.push_back(p);
	}
	sort(blue.begin(), blue.end());
	//ここまででソート終了 問題なし
	int ans = 0;
	for (int i = 0;i < n;i++) {
		int num = -1;
		for (int j = 0;red[j].first < blue[i].first&&j < red.size();j++) {
			if(red[j].second < blue[i].second){
				if (num == -1)num = j;
				else if(red[num].second < red[j].second)num = j;
		}
		if (num!=-1) {
			ans++;
			red.erase(red.begin() + num);
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<pair<int, int>>red;
	vector<pair<int, int>>blue;
	for (int i = 0;i < n;i++) {
		int a, b;
		cin >> a >> b;
		pair<int, int>p = make_pair(a, b);
		push_back(p);
	}
	sort(red.begin(), red.end());
	for (int i = 0;i < n;i++) {
		int a, b;
		cin >> a >> b;
		pair<int, int>p = make_pair(a, b);
		push_back(p);
	}
	sort(blue.begin(), blue.end());
	//ここまででソート終了 問題なし
	int ans = 0;
	for (int i = 0;i < n;i++) {
		int num = -1;
		for (int j = 0;red[j].first < blue[i].first&&j < red.size();j++) {
			if(red[j].second < blue[i].second){
				if (num == -1)num = j;
				else if(red[num].second < red[j].second)num = j;
		}
		if (num!=-1) {
			ans++;
			red.erase(red.begin() + num);
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'push_back' was not declared in this scope
   15 |                 push_back(p);
      |                 ^~~~~~~~~
a.cc:22:17: error: 'push_back' was not declared in this scope
   22 |                 push_back(p);
      |                 ^~~~~~~~~
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include<set>
#include<vector>
int N, A[101], B[101], C[101], D[101];
void _main() {
    cin >> N;
    rep(i, 0, N) cin >> A[i] >> B[i];
    rep(i, 0, N) cin >> C[i] >> D[i];
 
    BipartiteMatching bm;
    bm.init(N, N);
    rep(i, 0, N) rep(j, 0, N) {
        if (A[i] < C[j] and B[i] < D[j]) bm.add(i, j);
    }
    cout << bm.solve() << endl;
}

Compiler output:
a.cc: In function 'void _main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     cin >> N;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:9: error: 'i' was not declared in this scope
    9 |     rep(i, 0, N) cin >> A[i] >> B[i];
      |         ^
a.cc:9:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
    9 |     rep(i, 0, N) cin >> A[i] >> B[i];
      |     ^~~
      |     frexp
a.cc:12:5: error: 'BipartiteMatching' was not declared in this scope
   12 |     BipartiteMatching bm;
      |     ^~~~~~~~~~~~~~~~~
a.cc:13:5: error: 'bm' was not declared in this scope; did you mean 'tm'?
   13 |     bm.init(N, N);
      |     ^~
      |     tm
a.cc:17:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |     cout << bm.solve() << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |     cout << bm.solve() << endl;
      |                           ^~~~
      |                           std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include<set>
#include<vector>
#include <map>
#include <algorithm>
using namespace std;

int main() {
	int i, n, aa, bb, cc, dd;
	cin >> n;
	vector<int> a[n], b[n], c[n], d[n];
	for(i=0; i<n; i++) {
		cin >> aa >> bb;
		a.insert(a.begin(), aa);
	}
	for(i=0; i<n; i++) {
		cin >> cc >> dd;
	}

	sort(a.begin(), a.end());

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: request for member 'insert' in 'a', which is of non-class type 'std::vector<int> [n]'
   16 |                 a.insert(a.begin(), aa);
      |                   ^~~~~~
a.cc:16:28: error: request for member 'begin' in 'a', which is of non-class type 'std::vector<int> [n]'
   16 |                 a.insert(a.begin(), aa);
      |                            ^~~~~
a.cc:22:16: error: request for member 'begin' in 'a', which is of non-class type 'std::vector<int> [n]'
   22 |         sort(a.begin(), a.end());
      |                ^~~~~
a.cc:22:27: error: request for member 'end' in 'a', which is of non-class type 'std::vector<int> [n]'
   22 |         sort(a.begin(), a.end());
      |                           ^~~
Language: Java

import java.util.Scanner;
import java.util.Arrays;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int[][] red = new int[N][2];
    int[][] blue = new int[N][2];

    for (int i = 0; i < N; i++){
      red[i][0] = scanner.nextInt();
      red[i][1] = scanner.nextInt();
    }
    for (int i = 0; i < N; i++){
      blue[i][0] = scanner.nextInt();
      blue[i][1] = scanner.nextInt();
    }
    int count = 0;
    boolean[] visited = new boolean[N];

    Arrays.sort(blue, Comparator.comparingInt(o1 -> o1[0]));
    Arrays.sort(red, Comparator.comparingInt(o1 -> -o1[1]));

    for (int i = 0; i < N; i++){
      for (int j = 0; j < N; j++){
        if (!visited[j] && blue[i][0] > red[j][0] && blue[i][1] > red[j][1]){
          count++;
          visited[j] = true;
          break;
        }
      }
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:22: error: cannot find symbol
    Arrays.sort(blue, Comparator.comparingInt(o1 -> o1[0]));
                      ^
  symbol:   variable Comparator
  location: class Main
Main.java:23: error: cannot find symbol
    Arrays.sort(red, Comparator.comparingInt(o1 -> -o1[1]));
                     ^
  symbol:   variable Comparator
  location: class Main
2 errors