Language: C++

#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <limits.h>
#include <math.h>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'

using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef vector<int> vint;
const ll INF = INT_MAX;

struct graph {
    typedef long long flow_type;
    struct edge {
        int src, dst;
        flow_type capacity, flow;
        size_t rev;
    };
    int n;
    vector<vector<edge>> adj;
    graph(int n) : n(n), adj(n) { }
    void add_edge(int src, int dst, flow_type capacity) {
        adj[src].push_back({src, dst, capacity, 0, adj[dst].size()});
        adj[dst].push_back({dst, src, 0, 0, adj[src].size()-1});
    }
    int max_flow(int s, int t) {
        vector<bool> visited(n);
        function<flow_type(int,flow_type)> augment = [&](int u, flow_type cur) {
            if (u == t) return cur;
            visited[u] = true;
            for (auto &e: adj[u]) {
                if (!visited[e.dst] && e.capacity > e.flow) {
                    flow_type f = augment(e.dst, min(e.capacity - e.flow, cur));
                    if (f > 0) {
                        e.flow += f;
                        adj[e.dst][e.rev].flow -= f;
                        return f;
                    }
                }
            }
            return flow_type(0);
        };
        for (int u = 0; u < n; ++u)
            for (auto &e: adj[u]) e.flow = 0;

        flow_type flow = 0;
        while (1) {
            fill(visited.begin(),visited.end(), false);
            flow_type f = augment(s, INF);
            if (f == 0) break;
            flow += f;
        }
        return flow;
    }
};

int main() {
  int N;
  cin >> N;
  //debug(N);
  vint a(N),b(N),c(N),d(N);
  graph g(2*N+2);
  repeat(i,N){
    cin >> a[i] >> b[i];
  }
  repeat(i,N){
    cin >> c[i] >> d[i];
  }

  repeat(i,N){
    repeat(j,N){
      if(a[i]<c[j] && b[i]<d[j]){
        g.add_edge(i+1,j+1+N,1);
      }
    }
  }
  repeat(i,N){
    g.add_edge(0,i+1,1);
    g.add_edge(i+1+N,2*N+1,1);
  }
  ll ans = g.max_flow(0,2*N+1);
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In member function 'int graph::max_flow(int, int)':
a.cc:40:9: error: 'function' was not declared in this scope
   40 |         function<flow_type(int,flow_type)> augment = [&](int u, flow_type cur) {
      |         ^~~~~~~~
a.cc:12:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by adding '#include <functional>'
   11 | #include <math.h>
  +++ |+#include <functional>
   12 | 
a.cc:40:41: error: expression list treated as compound expression in functional cast [-fpermissive]
   40 |         function<flow_type(int,flow_type)> augment = [&](int u, flow_type cur) {
      |                                         ^
a.cc:40:27: error: expected primary-expression before '(' token
   40 |         function<flow_type(int,flow_type)> augment = [&](int u, flow_type cur) {
      |                           ^
a.cc:40:28: error: expected primary-expression before 'int'
   40 |         function<flow_type(int,flow_type)> augment = [&](int u, flow_type cur) {
      |                            ^~~
a.cc:40:41: error: expected primary-expression before ')' token
   40 |         function<flow_type(int,flow_type)> augment = [&](int u, flow_type cur) {
      |                                         ^
a.cc:40:44: error: 'augment' was not declared in this scope
   40 |         function<flow_type(int,flow_type)> augment = [&](int u, flow_type cur) {
      |                                            ^~~~~~~