Language: C++

#include<bits/stdc++.h>

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:13:1: error: 'vector' does not name a type
   13 | vector<edge> G[MAX_V];
      | ^~~~~~
a.cc: In function 'void add_edge(int, int, int)':
a.cc:17:5: error: 'G' was not declared in this scope
   17 |     G[from].push_back((edge){to, cap, G[to].size()});
      |     ^
a.cc: In function 'int dfs(int, int, int)':
a.cc:24:25: error: 'G' was not declared in this scope
   24 |     for (int i = 0; i < G[v].size(); i++) {
      |                         ^
a.cc:27:34: error: 'min' was not declared in this scope; did you mean 'std::min'?
   27 |             int d = dfs(e.to, t, min(f, e.cap));
      |                                  ^~~
      |                                  std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc: In function 'int main()':
a.cc:50:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   50 |     cin >> n;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:51:5: error: 'vector' was not declared in this scope
   51 |     vector<int> a(n), b(n), c(n), d(n);
      |     ^~~~~~
a.cc:51:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:51:12: error: expected primary-expression before 'int'
   51 |     vector<int> a(n), b(n), c(n), d(n);
      |            ^~~
a.cc:53:16: error: 'a' was not declared in this scope
   53 |         cin >> a[i] >> b[i];
      |                ^
a.cc:53:24: error: 'b' was not declared in this scope
   53 |         cin >> a[i] >> b[i];
      |                        ^
a.cc:56:16: error: 'c' was not declared in this scope
   56 |         cin >> c[i] >> d[i];
      |                ^
a.cc:56:24: error: 'd' was not declared in this scope
   56 |         cin >> c[i] >> d[i];
      |                        ^
a.cc:63:17: error: 'a' was not declared in this scope
   63 |             if (a[i] < c[j] and b[i] < d[j]) {
      |                 ^
a.cc:63:24: error: 'c' was not declared in this scope
   63 |             if (a[i] < c[j] and b[i] < d[j]) {
      |                        ^
a.cc:63:33: error: 'b' was not declared in this scope
   63 |             if (a[i] < c[j] and b[i] < d[j]) {
      |                                 ^
a.cc:63:40: error: 'd' was not declared in this scope
   63 |             if (a[i] < c[j] and b[i] < d[j]) {
      |                                        ^
a.cc:74:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   74 |     cout << max_flow(start, goal) << 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:74:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   74 |     cout << max_flow(start, goal) << endl;
      |                                      ^~~~
      |                                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~