Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
#include <iomanip>
#include <map>
#include <math.h>
typedef long long ll;
using namespace std;
const int MOD = 1000000007;

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }

int main() {
 
     int N;
     cin >> N;
 
     VI a(N), b(N);
     REP(i, N) cin >> a[i] >> b[i];
 
     VI c(N), d(N);
     REP(i, N) cin >> c[i] >> d[i];
 
     VPII ab(N);
     REP(i, N) ab[i] = MP(a[i], b[i]);
 
     VPII cd(N);
     REP(i, N) cd[i] = MP(c[i], d[i]);
 
     SORT(ab);
     SORT(cd);
 
 
     VI used(N, false);
     int ans = 0;
     for (int i = 0; i < N; i++) {
         PII B = cd[i];
         int index = -1;
         int maxV = INT_MIN;
         for (int j = 0; j < N; j++) {
             if (!used[j] && ab[j].second < B.second && ab[j].first < B.first && maxV < ab[j].second) {
                 index = j;
                 maxV = C_MAX(maxV, ab[j].second);
             }
         }
         if (index != -1) {
             ans++;
             used[index] = true;
         }
     }
 
     OUT_L(ans);
 
     return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:23:6: error: 'VI' was not declared in this scope
   23 |      VI a(N), b(N);
      |      ^~
a.cc:24:10: error: 'i' was not declared in this scope
   24 |      REP(i, N) cin >> a[i] >> b[i];
      |          ^
a.cc:24:6: error: 'REP' was not declared in this scope
   24 |      REP(i, N) cin >> a[i] >> b[i];
      |      ^~~
a.cc:26:8: error: expected ';' before 'c'
   26 |      VI c(N), d(N);
      |        ^~
      |        ;
a.cc:29:6: error: 'VPII' was not declared in this scope
   29 |      VPII ab(N);
      |      ^~~~
a.cc:32:10: error: expected ';' before 'cd'
   32 |      VPII cd(N);
      |          ^~~
      |          ;
a.cc:35:11: error: 'ab' was not declared in this scope; did you mean 'abs'?
   35 |      SORT(ab);
      |           ^~
      |           abs
a.cc:35:6: error: 'SORT' was not declared in this scope
   35 |      SORT(ab);
      |      ^~~~
a.cc:36:11: error: 'cd' was not declared in this scope
   36 |      SORT(cd);
      |           ^~
a.cc:39:8: error: expected ';' before 'used'
   39 |      VI used(N, false);
      |        ^~~~~
      |        ;
a.cc:42:10: error: 'PII' was not declared in this scope
   42 |          PII B = cd[i];
      |          ^~~
a.cc:44:21: error: 'INT_MIN' was not declared in this scope
   44 |          int maxV = INT_MIN;
      |                     ^~~~~~~
a.cc:12:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <math.h>
  +++ |+#include <climits>
   12 | typedef long long ll;
a.cc:46:19: error: 'used' was not declared in this scope
   46 |              if (!used[j] && ab[j].second < B.second && ab[j].first < B.first && maxV < ab[j].second) {
      |                   ^~~~
a.cc:46:45: error: 'B' was not declared in this scope
   46 |              if (!used[j] && ab[j].second < B.second && ab[j].first < B.first && maxV < ab[j].second) {
      |                                             ^
a.cc:48:25: error: 'C_MAX' was not declared in this scope; did you mean 'TMP_MAX'?
   48 |                  maxV = C_MAX(maxV, ab[j].second);
      |                         ^~~~~
      |                         TMP_MAX
a.cc:53:14: error: 'used' was not declared in this scope
   53 |              used[index] = true;
      |              ^~~~
a.cc:57:6: error: 'OUT_L' was not declared in this scope
   57 |      OUT_L(ans);
      |      ^~~~~