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

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

const int maxn=1e3+7;
struct node{
    int x,y;
    bool operator <(const node &a)const {
        return a.x<x&&a.y<y;
    }
}a[maxn],b[maxn];

int vis[maxn];

int main (){
    int n;scanf("%d",&n);
    for(int i=0;i<n;i++) scanf("%d %d",&a[i].x,&a[i].y);
    for(int i=0;i<n;i++) scanf("%d %d",&b[i].x,&b[i].y);
    sort(a,a+n);sort(b,b+n);
    memset(vis,0,(n+3)*sizeof(int));
    int ans=0;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(!vis[j]&&!vis[i]&&&&a[i].x<b[j].x&&a[i].y<b[j].y){
                ans++;
                vis[j]=1;
                break;
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:37: error: expected ')' before '[' token
   24 |             if(!vis[j]&&!vis[i]&&&&a[i].x<b[j].x&&a[i].y<b[j].y){
      |               ~                     ^
      |                                     )
a.cc:24:36: error: label 'a' used but not defined
   24 |             if(!vis[j]&&!vis[i]&&&&a[i].x<b[j].x&&a[i].y<b[j].y){
      |                                    ^
Language: C++

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

typedef pair<int, int> P;

int main() {
    int N;
    cin >> N;
    vector<P> a(N), b(N);
    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(b.begin(), b.end());

    vector<int> v;
    for(int i = 0; i < N; i++) {
        int y = 1e9;
        int n = -1;
        for(int j = 0; j < N; j++) {
            for(auto e: v) if(e == j) continue;
            if(b[i].first > a[j].first && b[i].second > a[j].second){
                if(y > a[j].second) {
                    y = a[j].second;
                    n = j;
                }
            }
        }
        if(n != -1) v.push_back(i);
    }

    cout << v.size() << endl;

    return 0;
}

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

#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<algorithm>

using namespace std;

// 二部グラフ最大マッチング
vector<int> G[200];
int match[200];
bool used[200];

void add_edge(int u, int v) {
	G[u].push_back(v);
	G[v].push_back(u);
}

bool dfs(int v) {
	used[v] = true;
	for (int i = 0; i < G[v].size(); i++) {
		int u = G[v][i], w = match[u];
		if (w < 0 || !used[w] && dfs(w)) {
			match[v] = u;
			match[u] = v;
			return true;
		}
	}
	return false;
}

int bipartite_matching(int n) {
	int res = 0;
	memset(match, -1, sizeof(match));
	for (int v = 0; v < n; v++) {
		if (match[v] < 0) {
			memset(used, 0, sizeof(used));
			if (dfs(v)) res++;
		}
	}
	return res;
}




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

	int ans = bipartite_matching(n);
	
	cout << ans << endl;


	return 0;
}


Compiler output:
a.cc: In function 'int bipartite_matching(int)':
a.cc:34:9: error: 'memset' was not declared in this scope
   34 |         memset(match, -1, sizeof(match));
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<algorithm>
  +++ |+#include <cstring>
    6 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)

P ab[114],cd[114];
bool B[114];
int main(){
	int n;cin>>n;
	
	rep(i,n){
		int a,b;cin>>a>>b;ab[i]=P(a,b);
		}
	rep(i,n){
		int a,b;cin>>a>>b;cd[i]=P(a,b);
		}	
		
		sort(ab,ab+n);
		fill(B,B+n,true);
		int ans=0;
		
		rep(i,n){
			int my=-1,nm=-1;
			rep(j,n){
				if(ab[i].first<cd[i].first&&ab[i].second<cd[i].second&&B[i]&&my<cd[i].second){
					my=cd[i].secnod;
					nm=i;
					}
				}
			ans++;
			B[nm]=false;	
			}
			cout<<ans<<endl;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:50: error: 'P' {aka 'struct std::pair<int, int>'} has no member named 'secnod'; did you mean 'second'?
   26 |                                         my=cd[i].secnod;
      |                                                  ^~~~~~
      |                                                  second
Language: Java

mport java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main {
    static class Point {
        int x;
        int y;
        float dist = 0;

        Point(int x, int y) {
            this.x = x;
            this.y = y;
            this.dist = x * x + y * y;
        }
        boolean canFriend(Point blue) {
            return this.x < blue.x && this.y < blue.y;
        }
    }
    public static void main(String[] args) {

        java.util.Scanner sc = new java.util.Scanner(System.in);

        Map<String, Integer> map = new HashMap<>();

        int n  = sc.nextInt();

        List<Point> ab = new ArrayList<>();
        List<Point> cd = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            ab.add(new Point(sc.nextInt(), sc.nextInt()));
        }
        for (int i = 0; i < n; i++) {
            cd.add(new Point(sc.nextInt(), sc.nextInt()));
        }
        ab.sort((o1, o2) -> {return (int)(o2.dist - o1.dist); });
        cd.sort((o1, o2) -> {return (int)(o2.dist - o1.dist); });

        int friends = 0;
        for (int i = 0; i < n; i++) {
            Point red = ab.get(i);
            for (int j = cd.size() - 1; j >= 0 ; --j) {
                Point blue = cd.get(j);
                if (red.canFriend(blue)) {
                    cd.remove(j);
                    ++friends;
                    break;
                }
            }
        }

        System.out.println(friends);
    }
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.ArrayList;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.HashMap;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.List;
^
Main.java:4: error: class, interface, enum, or record expected
import java.util.Map;
^
4 errors
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <cassert>
#include <cmath>
#include <cstdlib>
using namespace std;

int V;
vector<int> g[101010];
int match[101010];
bool used[101010];
void add_edge(int v, int u) {
        g[v].push_back(u);
        g[u].push_back(v);
}
bool dfs(int v) {
        used[v] = true;
        for (auto u : g[v]) {
                int w = match[u];
                if (w < 0 || (!used[w] && dfs(w))) {
                        match[v] = u;
                        match[u] = v;
                        return true;
                }
        }
        return false;
}
int BipartiteMatching() {
        int res = 0;
        memset(match, -1, sizeof match);
        for (int v = 0; v < V; v ++) {
                if (match[v] < 0) {
                        memset(used, 0, sizeof used);
                        if (dfs(v)) {
                                res ++;
                        }
                }
        }
        return res;
}

int main() {
        int n;
        scanf("%d", &n);
        vector<pair<int, int>> u, v;
        for (int i = 0; i < n; i ++) {
                int a, b;
                scanf("%d%d", &a, &b);
                u.emplace_back(a, b);
        }
        for (int i = 0; i < n; i ++) {
                int a, b;
                scanf("%d%d", &a, &b);
                v.emplace_back(a, b);
        }
        V = 2 * n;
        for (int i = 0; i < n; i ++) {
                for (int j = 0; j < n; j ++) {
                        if (u[i].first < v[j].first && u[i].second < v[j].second) {
                                add_edge(i, j + n);
                        }
                }
        }
        printf("%d\n", BipartiteMatching());
        return 0;
}



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

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

int V;
vector<int> g[101010];
int match[101010];
bool used[101010];
void add_edge(int v, int u) {
        g[v].push_back(u);
        g[u].push_back(v);
}
bool dfs(int v) {
        used[v] = true;
        for (auto u : g[v]) {
                int w = match[u];
                if (w < 0 || (!used[w] && dfs(w))) {
                        match[v] = u;
                        match[u] = v;
                        return true;
                }
        }
        return false;
}
int BipartiteMatching() {
        int res = 0;
        memset(match, -1, sizeof match);
        for (int v = 0; v < V; v ++) {
                if (match[v] < 0) {
                        memset(used, 0, sizeof used);
                        if (dfs(v)) {
                                res ++;
                        }
                }
        }
        return res;
}

int main() {
        int n;
        scanf("%d", &n);
        vector<pair<int, int>> u, v;
        for (int i = 0; i < n; i ++) {
                int a, b;
                scanf("%d%d", &a, &b);
                u.emplace_back(a, b);
        }
        for (int i = 0; i < n; i ++) {
                int a, b;
                scanf("%d%d", &a, &b);
                v.emplace_back(a, b);
        }
        V = 2 * n;
        for (int i = 0; i < n; i ++) {
                for (int j = 0; j < n; j ++) {
                        if (u[i].first < v[j].first && u[i].second < v[j].second) {
                                add_edge(i, j + n);
                        }
                }
        }
        printf("%d\n", BipartiteMatching());
        return 0;
}



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

给定N个红点二维坐标N个蓝点二维坐标，如果红点横纵坐标都比蓝点小，那么它们能够构成一组。问最多能构成多少组。

Compiler output:
a.cc:1:1: error: extended character 。 is not valid in an identifier
    1 | 给定N个红点二维坐标N个蓝点二维坐标，如果红点横纵坐标都比蓝点小，那么它们能够构成一组。问最多能构成多少组。
      | ^
a.cc:1:1: error: extended character 。 is not valid in an identifier
a.cc:1:1: error: '\U00007ed9\U00005b9aN\U00004e2a\U00007ea2\U000070b9\U00004e8c\U00007ef4\U00005750\U00006807N\U00004e2a\U000084dd\U000070b9\U00004e8c\U00007ef4\U00005750\U00006807\U0000ff0c\U00005982\U0000679c\U00007ea2\U000070b9\U00006a2a\U00007eb5\U00005750\U00006807\U000090fd\U00006bd4\U000084dd\U000070b9\U00005c0f\U0000ff0c\U000090a3\U00004e48\U00005b83\U00004eec\U000080fd\U0000591f\U00006784\U00006210\U00004e00\U00007ec4\U00003002\U000095ee\U00006700\U0000591a\U000080fd\U00006784\U00006210\U0000591a\U00005c11\U00007ec4\U00003002' does not name a type
    1 | 给定N个红点二维坐标N个蓝点二维坐标，如果红点横纵坐标都比蓝点小，那么它们能够构成一组。问最多能构成多少组。
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int N;
vector <pair<int, int> > r;
vector <pair<int, int> > b;
vector <int> used;
int ans;

void solve(){
  for(int i=0; i<N; i++){
    for(int j=N-1; j>=0; j--){
      if(used[j]==1)continue;
      if(b[i].first > r[j].second && b[i].second > r[j].first){
        used[j]=1;
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
}

int main(void){
  cin >> N;
  r.resize(N);
  b.resize(N);
  used.resize(N);

  for(int i=0; i<N; i++){
    int x, y;
    cin >> x >> y;
    r[i]=make_pair(y, x);
  }

  for(int i=0; i<N; i++){
    int x, y;
    cin >> x >> y;
    b[i]=make_pair(x, y);
  }

  sort(r.begin(), r.end());
  sort(b.begin(), b.end());
  solve();
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   43 |   sort(r.begin(), r.end());
      |   ^~~~
      |   short
Language: Java

import java.util.*;
 class Node{
public int x;
public int y;
  public Node(){
x=0;
y=0;}
}   
public class Main{
  static int[][] line;
     static int[] used;
     static int[] linker;
     static int n;
       static  Node[] a;
     static Node[] b;
     public static void main(String[] args){
         Scanner in = new Scanner(System.in);
         n=in.nextInt();
       a= new Node[n];
     b= new Node[n];
    for(int i=0;i<a.length;i++){
      a[i]=new Node();
     b[i]=new Node();               
}   
   line=new int[n][n];
   used=new int[n];
   linker=new int[n];
 for(int i = 0; i<n;i++){ a[i].x=in.nextInt(); a[i].y=in.nextInt();}
         for(int i = 0; i<n;i++){ b[i].x=in.nextInt(); b[i].y=in.nextInt();}     
         for(int i=0;i<n;i++)
          for(int j=0;j<n;j++){
             if(a[i].x<=b[j].x && a[i].y<=b[j].y)
               line[i][j]=1;
        }
       System.out.println(hungary());
     }
   public static int hungary(){
   int sum=0;
  for(int i=0; i<n;i++){
     for(int j=0;j<n;j++)
         used[j]=0;
      if(find(i)) sum++;
}
return sum;
}
 private static boolean find(int x){
for(int i=0;i<n;i++){
if(line[x][i]==1 && used[i]==0){
used[i]=1;
if(linker[i]==0 || find(linker[i])){
linker[i]=x;
return true;
}
}
}
return false;}
 
    }
import java.util.*;
 class Node{
public int x;
public int y;
  public Node(){
x=0;
y=0;}
}   
public class Main{
  static int[][] line;
     static int[] used;
     static int[] linker;
     static int n;
       static  Node[] a;
     static Node[] b;
     public static void main(String[] args){
         Scanner in = new Scanner(System.in);
         n=in.nextInt();
       a= new Node[n];
     b= new Node[n];
    for(int i=0;i<a.length;i++){
      a[i]=new Node();
     b[i]=new Node();               
}   
   line=new int[n][n];
   used=new int[n];
   linker=new int[n];
 for(int i = 0; i<n;i++){ a[i].x=in.nextInt(); a[i].y=in.nextInt();}
         for(int i = 0; i<n;i++){ b[i].x=in.nextInt(); b[i].y=in.nextInt();}     
         for(int i=0;i<n;i++)
          for(int j=0;j<n;j++){
             if(a[i].x<b[j].x && a[i].y<b[j].y)
               line[i][j]=1;
        }
       System.out.println(hungary());
     }
   public static int hungary(){
   int sum=0;
  for(int i=0; i<n;i++){
     for(int j=0;j<n;j++)
         used[j]=0;
      if(find(i)) sum++;
}
return sum;
}
 private static boolean find(int x){
for(int i=0;i<n;i++){
if(line[x][i]==1 && used[i]==0){
used[i]=1;
if(linker[i]==0 || find(linker[i])){
linker[i]=x;
return true;
}
}
}
return false;}

    }
Submission

Compiler output:
Main.java:59: error: class, interface, enum, or record expected
import java.util.*;
^
Main.java:117: error: reached end of file while parsing
Submission
^
2 errors
Language: C++

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:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:4:9: error: 'i' was not declared in this scope
    4 |     rep(i, 0, N) cin >> A[i] >> B[i];
      |         ^
a.cc:4:5: error: 'rep' was not declared in this scope
    4 |     rep(i, 0, N) cin >> A[i] >> B[i];
      |     ^~~
a.cc:7:5: error: 'BipartiteMatching' was not declared in this scope
    7 |     BipartiteMatching bm;
      |     ^~~~~~~~~~~~~~~~~
a.cc:8:5: error: 'bm' was not declared in this scope
    8 |     bm.init(N, N);
      |     ^~
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout << bm.solve() << endl;
      |     ^~~~
a.cc:12:27: error: 'endl' was not declared in this scope
   12 |     cout << bm.solve() << endl;
      |                           ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  cin >> N;

  int a[101], b[101], c[101], d[101];
  for (int i = 0; i < N; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < N; i++) cin >> c[i] >> d[i];

  pair<int, int> red[101];
  pair<int, int> blue[101];

  for (int i = 0; i < N; i++) {
    red[i].first = a[i];
    red[i].second = b[i];
    blue[i].first = c[i];
    blue[i].second = d[i];
  }
  sort(red, red + N);
  sort(blue, blue + N);

  int ans = 0;

  int redcount[101] = {0};

  for (int i = 0; i < N; i++) {
    int redcandidate = 0;
    for (int j = 1; j < N; j++) {
      if (red[j].first < blue[i].first and red[j].second < blue[i].second){
        if (redcount[j] == 0) {
          if (red[redcandidate].first >= blue[i].first or red[redcandidate].second >= blue[i].second) {
            redcandidate = j;
          }
          if (red[j].second >= red[redcandidate].second) {
            redcandidate = j;
          }
        }
      }
    }
    if (red[redcandidate].first < blue[i].first and red[redcandidate].second < blue[i].second and redcount[redcandidate] == 0) {
      redcount[redcandidate]++;
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |   sort(red, red + N);
      |   ^~~~
      |   short
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef struct node
{
	int color,x,y;
	bool operator < (const struct node t) const
	{
		return y<t.y;	
	}
}NODE,*PNODE;
NODE a[202];
list<NODE> redlist;
int main()
{
	int n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %d",&a[i].x,&a[i].y);
		a[i].color=0;
	}
	for(i=n;i<2*n;i++)
	{
		scanf("%d %d",&a[i].x,&a[i].y);
		a[i].color=1;
	}
	sort(a,a+2*n);
	for(i=0;i<2*n;i++)
	{
		if(a[i].color==0)
		{
			redlist.insert(low_bound(redlist.begin(),redlist.end(),a[i]),a[i]);
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:40: error: 'low_bound' was not declared in this scope
   32 |                         redlist.insert(low_bound(redlist.begin(),redlist.end(),a[i]),a[i]);
      |                                        ^~~~~~~~~
Language: C++

#include"bits/stdc++.h"
using namespace std;
typedef struct node
{
	int x,y;
	bool color;
	bool operator < (const struct node t) const
	{
		return y<t.y;
	}
}NODE,*PNODE;
int main()
{
	int n,m;
	int i,j;
	int ans=0;
	link<NODE> redlist;
	NODE a[201];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %d",a[i].x,a[i].y);
		a[i].color=false;
	}
	for(i=0;i<n;i++)
	{
		scanf("%d %d",a[i+n].x,a[i+n].y);
		a[i].color=true;
	}
	sort(a,a+2*n);
	for(i=0;i<2*n;i++)
	{
		if(a[i].color==0)
		{
			redlist.insert(lower_bound(redlist.begin(),redlist.end(),a[i],a[i]);
		}
		else
		{
			int pos=lower_bound(redlist.begin(),redlist.end(),a[i]);
			if(pos>0)
			{
				redlist.erase(redlist.begin()+pos-1);
				ans++;
			}
		}
	}
	printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected primary-expression before '>' token
   17 |         link<NODE> redlist;
      |                  ^
a.cc:17:20: error: 'redlist' was not declared in this scope
   17 |         link<NODE> redlist;
      |                    ^~~~~~~
Language: C++

#include"bits/stdc++.h"
using namespace std;
typedef struct node
{
	int x,y;
	bool color;
	bool operator < (const struct node t) const
	{
		return y<t.y;
	}
}NODE,*PNODE;
int main()
{
	int n,m;
	int i,j;
	link<NODE> redlist;
	NODE a[201];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %d",a[i].x,a[i].y);
		a[i].color=false;
	}
	for(i=0;i<n;i++)
	{
		scanf("%d %d",a[i+n].x,a[i+n].y);
		a[i].color=true;
	}
	sort(a,a+2*n);
	for(i=0;i<2*n;i++)
	{
		if(a[i].color==0)
		{
			redlist.insert(lower_bound(redlist.begin(),redlist.end(),a[i],a[i]);
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: expected primary-expression before '>' token
   16 |         link<NODE> redlist;
      |                  ^
a.cc:16:20: error: 'redlist' was not declared in this scope
   16 |         link<NODE> redlist;
      |                    ^~~~~~~
Language: C++

// 二次元平面に，赤い点と青い点が N個ずつあります。
// i個目の赤い点の座標は (ai,bi) で，i個目の青い点の座標は (ci,di) です。
// 赤い点と青い点は，赤い点の x座標が青い点の x座標より小さく， また赤い点の
// y座標も青い点の y座標より小さいとき，仲良しペアになれます。
// あなたは最大で何個の仲良しペアを作ることができますか？ ただし，1つの点が複数のペアに所属することはできません。
//
// 入力例：
// 3
// 2 0
// 3 1
// 1 3
// 4 2
// 0 4
// 5 5
//
// 出力例：
// 2
// 例えば,(2,0)と(4,2)をペアにし,(3,1)と(5,5)をペアにすればよいです。

#include <iostream>
#include <string>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
using namespace std;

int main(){
  int count = 0;
  int N;
  cin >> N;
  vector<pair<int, int> > red(N);
  vector<pair<int, int> > usedred(N);
  for(int i=0; i<N; i++){
    cin >> red[i].first >> red[i].second;
    usedred[i].first = -1;
    usedred[i].second = -1;
  }
  vector<pair<int, int> > blue(N);
  vector<pair<int, int> > usedblue(N);
  for(int i=0; i<N; i++){
    cin >> blue[i].first >> blue[i].second;
    usedblue[i].first = -1;
    usedblue[i].second = -1;
  }
  sort(red.begin(), red.end());
  sort(blue.begin(), blue.end());

  int ii = 0;
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      if(usedred[i].first!=0 && usedred[i].second!=0 && usedblue[j].first!=0 && usedblue[j].second!=0){
        if(red[i].first < blue[j].first){
          if(red[i].second < blue[j].second){
            ii=i;
            while(red[ii].second < blue[j].second){
                ii++;
            }
            usedred[ii-1].first = 0;
            usedred[ii-1].second = 0;
            usedblue[j].first = 0;
            usedblue[j].second = 0;
            count++;
          }
        }
      }

    }
  }
  cout << count << endl;
　return 0;
}


Compiler output:
a.cc:70:1: error: extended character 　 is not valid in an identifier
   70 | 　return 0;
      | ^
a.cc: In function 'int main()':
a.cc:70:1: error: '\U00003000return' was not declared in this scope
   70 | 　return 0;
      | ^~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define LL long long
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int MOD=1e9+7;
//
const int MAX_V=300;
//2部マッチング
int V;//頂点数
VE G[MAX_V];//グラフ隣接リスト表現
int match[MAX_V];//マッチングのペア
bool used[MAX_V];//フラグ
//
void add_edge(int from,int to){
  G[from].PB(to);
  G[to].PB(from);
}
//増加パスを探す
bool DFS(int v){
  used[v]=true;
  FOR(i,0,(int)G[v].size()){
    int u=G[v][i],w=match[u];
    if(w<0||!used[w]&&DFS(w)){
      match[v]=u;
      match[u]=v;
      return true;
    }
  }
  return false;
}
//最大マッチング
int bipartite_matching(){
  int res=0;
  memset(match,-1,sizeof(match));
  FOR(v,0,V){
    if(match[v]<0){
      memset(used,0,sizeof(used));
      if(DFS(v)){
        res++;
      }
    }
  }
  return res;
}
//
int main(){
  int N;
  pair<int,int> R[100],B[100];
  cin>>N;
  FOR(i,0,N){
    cin>>R[i].FI>>R[i].SE;
  }
  FOR(i,0,N){
    cin>>B[i].FI>>B[i].SE;
  }
  V=N*2;
  FOR(i,0,N){
    FOR(j,0,N){
      if(B[i].FI>=R[j].FI&&B[i].SE>=R[j].SE){
        add_edge(i,j+N);
      }
    }
  }
  cout<<bipartite_matching()<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:49:3: error: 'memset' was not declared in this scope
   49 |   memset(match,-1,sizeof(match));
      |   ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <cmath>
  +++ |+#include <cstring>
    7 | #include <string>
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

class Point{
  public:
    int x;
    int y;
    vector<Point> relations;
    
    Point() {
      x = 0;
      y = 0;
      relations = vector<Point>();
    }

    Point(int x0, int y0) {
      x = x0;
      y = y0;
      relations = vector<Point>();
    }

    bool operator<(Point& p) {
      return x < p.x && y < p.y;
    }

    bool operator==(Point p) {
        return x == p.x && y == p.y;
    }
};

bool num_relations_asc(const Point left, const Point right) {
  return left.relations.size() < right.relations.size();
}

bool num_relations_desc(const Point left, const Point right) {
  return left.relations.size() > right.relations.size();
}

std::ostream &operator<<(std::ostream &os, Point const &p) {
    return os << "(" << p.x << ", " << p.y << ")";
}

int main() {
  int n;
  vector<Point> bps, rps;

  cin >> n;
  int x, y;
  
  // red
  REP(j,n) {
    cin >> x >> y;
    rps.push_back(Point(x, y));
  }
  
  // blue
  REP(j,n) {
    cin >> x >> y;
    bps.push_back(Point(x, y));
  }

  // make relations
  REP(i, n) {
    vector<int> tmp;
    REP(j, n) {
      if (rps[i] < bps[j]) {
        rps[i].relations.push_back(bps[j]);
        bps[j].relations.push_back(rps[i]);
      }
    }
  }

  // sort
  REP(i, n) {
    sort(bps[i].relations.begin(), bps[i].relations.end(), num_relations_asc);
  }

  int c=0;
  int idx;
  REP(i, n) {
    sort(bps.begin()+i, bps.end(), num_relations_asc);

    if (bps[i].relations.size() != 0) {
      c++;
      for(int j=i+1, n){
        bps[j].relations.erase(\
          remove(
            bps[j].relations.begin(), \
            bps[j].relations.end(), \
            bps[i].relations[0]\
          ),
          bps[j].relations.end());
      }
    }
  }
  
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:89:23: error: expected ';' before ')' token
   89 |       for(int j=i+1, n){
      |                       ^
      |                       ;
a.cc:89:23: error: expected primary-expression before ')' token
a.cc:89:23: error: expected ';' before ')' token
   89 |       for(int j=i+1, n){
      |                       ^
      |                       ;
Language: C++

n = int(input())
red = {}
blue = {}
for i in range(n):
	x, y = map(int, input().split())
	red[x] = y
for i in range(n):
	x, y = map(int, input().split())
	blue[x] = y
 
sortBlue = sorted(blue.items(), key=lambda x:x[0])
count = 0
for i in range(n):
	pair = {}
	for k, v in red.items():
		if (k < sortBlue[i][0]) and (v < sortBlue[i][1]):
			pair[k] = v
	if pair:
		sortPair = sorted(pair.items(), key=lambda x:-x[1])
		count += 1
		red.pop(sortPair[0][0])
		
print(count)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
a.cc:3:1: error: 'blue' does not name a type
    3 | blue = {}
      | ^~~~
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for i in range(n):
      | ^~~
a.cc:15:9: error: expected unqualified-id before 'for'
   15 |         for k, v in red.items():
      |         ^~~
Language: C++

#include<iostream>
using namespace std;

struct Point{
    int x,y;
};

void swap(Point a,Point b);

bool check(int x,int* used,int i);

int main(){
    int N;
    Point red[100],blue[100];
    cin >> N;
    for(int i=0; i<N; i++)
    cin >> red[i].x >> red[i].y;
    for(int i=0; i<N; i++)
    cin >> blue[i].x >> blue[i].y;

    for(int i=0; i<N-1; i++){
        for(int j=i; j<N; j++){
            if(red[i].x > red[j].x)
            swap(red[i],red[j]);
            if(blue[i].x > blue[j].x)
            swap(blue[i],blue[j]);
        }
    }

    int ans=0;
    int used[100],count=0;
    for(int i=0; i<N; i++){
        for(int j=0; red[i].x<blue[i].x && j<N; j++){
            bool a=check(j,used,count)
            if(a==false)
            continue;
            if(red[i].x<blue[j].x && red[i].y<blue[j].y){
                ans++;
                used[count]=j;
                break;
            }
        }
    }

    return 0;
}

void swap(Point a,Point b){
    Point tmp;
    tmp=a;
    a=b;
    b=tmp;
    return;
}

bool check(int x,int* used,int i){
    for(int a=0; a<=i; a++){
        if(*(used+i)==x)
        return false;
    }
    return true;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: expected ',' or ';' before 'if'
   35 |             if(a==false)
      |             ^~
Language: C++

#include<iostream>
using namespace std;

struct Point{
    int x,y;
};

void swap(Point a,Point b);

int main(){
    int N;
    Point red[100],blue[100];
    cin >> N;
    for(int i=0; i<N; i++)
    cin >> red[i].x >> red[i].y;
    for(int i=0; i<N; i++)
    cin >> blue[i].x >> blue[i].y;

    for(int i=0; i<N-1; i++){
        for(int j=i; j<N; j++){
            if(red[i].x > red[j].x)
            swap(red[i],red[j]);
            if(blue[i].x > blue[j].x)
            swap(blue[i],blue[j])
        }
    }

    int ans=0;
    int used[100],count=0;
    for(int i=0; i<N; i++){
        for(int j=0; red[i].x<blue[i].x && j<N; j++){
            if(red[i].x<blue[j].x && red[i].y<blue[j].y){
                ans++;
                used[count]=j;
                break;
            }
        }
    }

    return 0;
}

void swap(Point a,Point b){
    Point tmp;
    tmp=a;
    a=b;
    b=tmp;
    return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:34: error: expected ';' before '}' token
   24 |             swap(blue[i],blue[j])
      |                                  ^
      |                                  ;
   25 |         }
      |         ~
Language: C++

#include <cstdio>
#include <algorithm>
using namespace std;
struct me{
    int x,y;
}a[105],b[105];
bool f[105];
bool cmp1(struct me v1,struct me v2){
    return v1.y>v2.y;
}
bool cmp2(struct me v1,struct me v2){
    return v1.x+v1.y<v2.x+v2.y;
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&a[i].x,&a[i].y);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&b[i].x,&b[i].y);
    sort(a+1, a+1+n, cmp1);
    sort(b+1, b+1+n, cmp2);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(f[j]==false&&a[j].x<b[i].x&&a[j].y<b[i].y){
                f[j]=true;
                break;
            }
        }
    }
    int s=0;
    for(int i=1;i<=n;i++)
        if(f[i]==true)
            s++;
    printf("%d\n",s);
    return 0;
}
#include <cstdio>
#include <algorithm>
using namespace std;
struct me{
    int x,y;
}a[105],b[105];
bool f[105];
bool cmp1(struct me v1,struct me v2){
    return v1.y>v2.y;
}
bool cmp2(struct me v1,struct me v2){
    return v1.x+v1.y<v2.x+v2.y;
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&a[i].x,&a[i].y);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&b[i].x,&b[i].y);
    sort(a+1, a+1+n, cmp1);
    sort(b+1, b+1+n, cmp2);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(f[j]==false&&a[j].x<b[i].x&&a[j].y<b[i].y){
                f[j]=true;
                break;
            }
        }
    }
    int s=0;
    for(int i=1;i<=n;i++)
        if(f[i]==true)
            s++;
    printf("%d\n",s);
    return 0;
}


Compiler output:
a.cc:41:8: error: redefinition of 'struct me'
   41 | struct me{
      |        ^~
a.cc:4:8: note: previous definition of 'struct me'
    4 | struct me{
      |        ^~
a.cc:43:2: error: conflicting declaration 'int a [105]'
   43 | }a[105],b[105];
      |  ^
a.cc:6:2: note: previous declaration as 'me a [105]'
    6 | }a[105],b[105];
      |  ^
a.cc:43:9: error: conflicting declaration 'int b [105]'
   43 | }a[105],b[105];
      |         ^
a.cc:6:9: note: previous declaration as 'me b [105]'
    6 | }a[105],b[105];
      |         ^
a.cc:44:6: error: redefinition of 'bool f [105]'
   44 | bool f[105];
      |      ^
a.cc:7:6: note: 'bool f [105]' previously declared here
    7 | bool f[105];
      |      ^
a.cc:45:6: error: redefinition of 'bool cmp1(me, me)'
   45 | bool cmp1(struct me v1,struct me v2){
      |      ^~~~
a.cc:8:6: note: 'bool cmp1(me, me)' previously defined here
    8 | bool cmp1(struct me v1,struct me v2){
      |      ^~~~
a.cc:48:6: error: redefinition of 'bool cmp2(me, me)'
   48 | bool cmp2(struct me v1,struct me v2){
      |      ^~~~
a.cc:11:6: note: 'bool cmp2(me, me)' previously defined here
   11 | bool cmp2(struct me v1,struct me v2){
      |      ^~~~
a.cc:51:5: error: redefinition of 'int main()'
   51 | int main(){
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main(){
      |     ^~~~
Language: C++

#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <complex>
using namespace std;
int main()
{
	int n,a[103],b[103],c[103],d[103],ans=0,big[100],small[100];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
		big[i]=0;
	} 
	for(int i=0;i<n;i++){
		cin>>c[i]>>d[i];
		small[i]=0;
		for(int j=0;j<n;j++){
			if((a[j]<c[i]) and (b[j]<d[i])){
				small[i]++;
				big[j]++;
			}
		}
	} 
	while(1){
		int k=-1;
		int count=101;
		for(int i=0;i<n;i++){
			if(small[i]<=0) continue;
			if(small[i]<count){
				k=i;
				count=small[i];
			}
		}
		if(count>100) break;
		small[k]=0;
		count=0;
		int x=-1;
		int count1=101;
		for(int j=0;j<n;j++){
			if(big[j]<=0) continue;
			if(a[j]<c[k] and b[j]<d[k])){
				big[j]--;
				if(big[j]<count1) {
					count1=big[j];
					x=j;
				}
				count++;
			}
		}
		if(count>0) ans++;
		if(x>=0) {
			big[x]=0;
			for(int i=0;i<n;i++)
				if((a[x]<c[i]) and (b[x]<d[i]) small[i]--;
	  }
	}
	cout<<ans;
	system ("pause");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:52: error: expected primary-expression before ')' token
   55 |                         if(a[j]<c[k] and b[j]<d[k])){
      |                                                    ^
a.cc:68:63: error: expected ';' before 'small'
   68 |                                 if((a[x]<c[i]) and (b[x]<d[i]) small[i]--;
      |                                                               ^~~~~~
      |                                                               ;
a.cc:69:11: error: expected primary-expression before '}' token
   69 |           }
      |           ^
a.cc:68:75: error: expected ')' before '}' token
   68 |                                 if((a[x]<c[i]) and (b[x]<d[i]) small[i]--;
      |                                   ~                                       ^
      |                                                                           )
   69 |           }
      |           ~                                                                
a.cc:69:11: error: expected primary-expression before '}' token
   69 |           }
      |           ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <random>
#include <unordered_set>
#include <complex>
using namespace std;
int a[103];
int b[103];
int c[103];
int d[103];
int main()
{
	int n,p[100],o[100],ans=0;	
	cin>>n ;
	for(int i=0;i<n;i++){
	  cin>>a[i]>>b[i];
	  p[i]=0;
	} 
	for(int j=0;j<n;j++){
  	  cin>>c[j]>>d[j];
	  o[j]=0;
	  for(int q=0;q<n;q++){
	    if((a[q]<c[j]) and (b[q]<d[j])){
          o[j]++;
          p[q]++;
			}
		}
	} 
	for(;;){
	  int k=-1;
	  int count=101;
	  for(int i1=0;i1<n;i1++)
	    if(o[i1] > 0)
	      if(o[i1]<count){
			k=i1;
			  count=o[i1];
	}
     if(count>100) break;
	 o[k]=0;
	 count=0;
	 int x=-1;
	 int count1=101;
	 for(int j1=0;j1<n;j1++)
       if(p[j1] > 0)
       if((a[j1]>c[k])and (b[j1]<d[k])){
	     p[j1]--;
		 if(p[j1]<count1) {
		   count1=p[j1];
           x=j1;
				}
         count++;
			}
		}
	 if(count>0) ans++;
	 if(x>=0) {
		p[x]=0;
		for(int q1=0;q1<n;q1++)
		  if((a[x]<c[q1]) and (b[x]<d[q1])) o[q1]--;
	    }
   }
  cout<<ans;
  system ("pause");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:18: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
   69 |          if(count>0) ans++;
      |             ~~~~~^~
a.cc:70:13: error: 'x' was not declared in this scope
   70 |          if(x>=0) {
      |             ^
a.cc: At global scope:
a.cc:76:3: error: 'cout' does not name a type
   76 |   cout<<ans;
      |   ^~~~
a.cc:77:10: error: expected constructor, destructor, or type conversion before '(' token
   77 |   system ("pause");
      |          ^
a.cc:78:3: error: expected unqualified-id before 'return'
   78 |   return 0;
      |   ^~~~~~
a.cc:79:1: error: expected declaration before '}' token
   79 | }
      | ^
Language: C++

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

struct Point{
  int x;
  int y;
}
struct Pair{
  point red;
  point blue;
}

int N;
list<Point> reds;
list<Point> blues;
list<Pair> pairs;
typedef list<Point>::iterator ItP;

bool cmpYDescendant(const Point &left, const Point &right) {
    return left.y > right.y;
}
 
bool cmpXAscendant(const Point &left, const Point &right) {
    return left.x < right.x;
}

int main(){
	point p;
  	cin>>N;
  	for(int i=0;i<N;i++){
      cin>>p.x>>p.y;
      reds.push_back(p)
    }
  	for(int i=0;i<N;i++){
		cin>>p.x>>p.y;
      	blues.push_back(p)
    }
  	reds.sort(cmpYDescendant);
  	blue.sort(cmpXAscendant);
  	ItP it_b = blues.begin();
  	while(it_b != blues.end()) {
        bool found = false;
        ItP it_r = reds.begin();
 
        while(it_r != reds.end()) {
            if ((*it_r).x < (*it_b).x && (*it_r).y < (*it_b).y) {
                Pair p;
 
                found = true;
                p.red = *it_r;
                p.blue = *it_b;
                pairs.push_back(p);
                reds.erase(it_r);
                break;
            }
 
            ++it_r;
        }
 
        ++it_b
    }
 
    cout << pairs.size() << endl;
}
        


Compiler output:
a.cc:9:2: error: expected ';' after struct definition
    9 | }
      |  ^
      |  ;
a.cc:11:3: error: 'point' does not name a type; did you mean 'Point'?
   11 |   point red;
      |   ^~~~~
      |   Point
a.cc:12:3: error: 'point' does not name a type; did you mean 'Point'?
   12 |   point blue;
      |   ^~~~~
      |   Point
a.cc:13:2: error: expected ';' after struct definition
   13 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:30:9: error: 'point' was not declared in this scope; did you mean 'Point'?
   30 |         point p;
      |         ^~~~~
      |         Point
a.cc:33:12: error: 'p' was not declared in this scope
   33 |       cin>>p.x>>p.y;
      |            ^
a.cc:37:22: error: 'p' was not declared in this scope
   37 |                 cin>>p.x>>p.y;
      |                      ^
a.cc:41:9: error: 'blue' was not declared in this scope; did you mean 'blues'?
   41 |         blue.sort(cmpXAscendant);
      |         ^~~~
      |         blues
a.cc:52:19: error: 'struct Pair' has no member named 'red'
   52 |                 p.red = *it_r;
      |                   ^~~
a.cc:53:19: error: 'struct Pair' has no member named 'blue'
   53 |                 p.blue = *it_b;
      |                   ^~~~
a.cc:62:15: error: expected ';' before '}' token
   62 |         ++it_b
      |               ^
      |               ;
   63 |     }
      |     ~
Language: C++

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

vector<int> adj[210];
int match[210];
bool used[210];

bool dfs(int v)
{
	used[v] = true;

	for (int i = 0; i < adj[v].size(); i++)
	{
		int u = adj[v][i], w = match[u];

		
		if (w < 0 || (!used[w] && dfs(w)))
		{
			match[v] = u;
			match[u] = v;
			return true;
		}
		
	}
	return false;
}

int main()
{
	int n, a[110], b[110], c[110], d[110];

	cin >> n;

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

	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			if (a[i] < c[j] && b[i] < d[j])
			{
				adj[i].push_back(j + n);
				adj[j + n].push_back(i);
			}
		}
	}

	int res = 0;

	memset(match, -1, sizeof(match));

	for (int i = 1; i <= n; i++)
	{
		if (match[i] < 0)
		{
			memset(used, 0, sizeof(used));

			if (dfs(i))
			{
				res++;
			}
		}
	}
	cout << res << endl;
}

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

    #include "bits/stdc++.h"
     
    using namespace std;
     
    typedef long long LL;
    typedef unsigned long UL;
     
    #define FOR(i,a,b) for(int i=(a);i<(b);++i)
    #define REP(i,n) for(int i=0;i<(n);++i)
     
    int main()
    {
        int n;
        cin >> n;
        
        vector<pair<int, int>> ab(n), cd(n);
        REP(i, n)
        {
            cin >> ab[i].first >> ab[i].second;
        }
        REP(i, n)
        {
            cin >> cd[i].first >> cd[i].second;
        }
     
        sort(ab.begin(), ab.end(),generator<pairt<int,int>>);
        sort(cd.begin(), cd.end());
     
        int ans = 0, mj;
        vector<int> used(n, -1);
     
        REP(i, n)
        {
            mj = 2 * n;
            REP(j, n)
            {
                if (ab[i].first < cd[j].first && ab[i].second < cd[j].second && find(used.begin(), used.end(), j) == used.end() && cd[j].second == min(cd[j].second, mj))
                {
                    used[i] = j;
                    mj = cd[j].second;
                }
            }
     
            if (used[i] != -1)
            {
                ++ans;
            }
        }
     
        cout << ans << endl;
     
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:26:35: error: 'generator' was not declared in this scope
   26 |         sort(ab.begin(), ab.end(),generator<pairt<int,int>>);
      |                                   ^~~~~~~~~
a.cc:26:45: error: 'pairt' was not declared in this scope
   26 |         sort(ab.begin(), ab.end(),generator<pairt<int,int>>);
      |                                             ^~~~~
a.cc:26:51: error: expected primary-expression before 'int'
   26 |         sort(ab.begin(), ab.end(),generator<pairt<int,int>>);
      |                                                   ^~~
a.cc:26:55: error: expected primary-expression before 'int'
   26 |         sort(ab.begin(), ab.end(),generator<pairt<int,int>>);
      |                                                       ^~~
Language: C++

#include<bits/stdc++.h>
#define fi first
#define se second
#define show(x) cerr<<#x<<"="<<x<<"\n"
typedef long long ll;
using namespace std;
const ll inf=(ll)1e14;
int n;
vector<pair<int,int> > aka,ao;

struct edge
{
  int to;
  ll cap;
  int rev;
};
vector<edge> v[211];
int level[211];
int iter[211];

void add_edge(int from,int to,ll cost){
  v[from].push_back({to,cost,(int)v[to].size()});
  v[to].push_back({from,0,(int)v[from].size()-1});
}

void bfs(int s){
  memset(level,-1,sizeof(level));
  queue<int> q;
  q.push(s);
  level[s]=0;
  while(!q.empty()){
    int now=q.front();
    q.pop();
    for(int i=0;i<(int)v[now].size();i++){
      if(v[now][i].cap>0 && level[v[now][i].to]<0){
        level[v[now][i].to]=level[now]+1;
        q.push(v[now][i].to);
      }
    }
  }
}

int dfs(int now,int t,ll f){
  if(now==t)return f;
  for(int &i=iter[now];i<(int)v[now].size();i++){
    if(v[now][i].cap>0 && level[now]<level[v[now][i].to]){
      int d=dfs(v[now][i].to,t,min(f,v[now][i].cap));
      if(d>0){
        v[now][i].cap-=d;
        v[v[now][i].to][v[now][i].rev].cap+=d;
        return d;
      }
    }
  }
  return 0;
}

int max_flow(int s,int t){
  int flow=0;
  for(;;){
    bfs(s);
    if(level[t]<0)return flow;
    memset(iter,0,sizeof(iter));
    int f;
    while((f=dfs(s,t,inf))>0){
      flow+=f;
    }
  }
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout<<fixed;
#ifdef LOCAL_DEFINE
  FILE *stream1;
  //FILE *stream2;
  stream1=freopen("in","r",stdin);
  //stream2=freopen("out","w",stdout);
  if(stream1==NULL)return 0;
  //if(stream2==NULL)return 0;
#endif
  cin>>n;
  int s=2*n;
  int t=s+1;
  for(int i=0;i<n;i++){
    int a,b;cin>>a>>b;
    aka.push_back({a,b});
    add_edge(s,i,1);
  }
  for(int i=0;i<n;i++){
    int a,b;cin>>a>>b;
    add_edge(n+i,t,1);
    ao.push_back({a,b});
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(aka[j].fi<ao[i].fi && aka[j].se<ao[i].se){
        add_edge(j,n+i,1);
      }
    }
  }
  print(max_flow(s,t));
#ifdef LOCAL_DEFINE
  cerr<<"Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC<<"s.\n";
  fclose(stream1);
  //fclose(stream2);
#endif
  return 0;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:104:3: error: 'print' was not declared in this scope; did you mean 'rint'?
  104 |   print(max_flow(s,t));
      |   ^~~~~
      |   rint
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <climits>
#include <set>
#include <deque>
#include <queue>
#include <bitset>
#include <stack>

#define mod 1000000007
#define INF2 9999999999
#define INF (1<<30)
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define P pair<int, int>

using namespace std;
using ll = long long;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int DX[] = {1, 1, 0, -1, -1, -1, 0, 1};
int DY[] = {0, -1, -1, -1, 0, 1, 1, 1};

struct edge {int from, to, cost; };

const int MAX_V = 200;
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];

void add_edge(int u, int v){
    G[u].push_back(v);
    G[v].push_back(u);
}

bool dfs(int v){
    used[v] = true;
    for(int i = 0; i < G[v].size(); i++){
        int u = G[v][i], w = match[u];
        if(w < 0 || (!used[w] && dfs(w))){
            match[v] = u;
            match[u] = v;
            return true;
        }
    }
    return false;
}

int bipartite_matching(){
    int res = 0;
    memset(match, -1, sizeof(match));
    for(int v = 0; v < V; v++){
        if(match[v] < 0){
            memset(used, 0, sizeof(used));
            if(dfs(v)){
                res++;
            }
        }
    }
    return res;
}

void solve(){
    cin >> V;
    int a[V], b[V], c[V], d[V];
    rep(i, V) cin >> a[i] >> b[i];
    rep(i, V) cin >> c[i] >> d[i];
    rep(i, V){
        rep(j, V){
            if(a[i] < c[j] && b[i] < d[j]){
                add_edge(i, V+j);
            }
        }
    }
    cout << bipartite_matching() << endl;
}

int main(){
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:58:5: error: 'memset' was not declared in this scope
   58 |     memset(match, -1, sizeof(match));
      |     ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   14 | #include <stack>
  +++ |+#include <cstring>
   15 |