Language: C++

import sequtils , queues
type
  Edge* = object
    ## Edge Object , edit this to add more information like distance.
    to : int
  GEEdge = object
    to : int
    num : int
  Graph*[E] = seq[seq[E]]
    ## Graph Object.
  Edm = object
    mate : seq[int]
    label : seq[int]
    first : seq[int]
    g : Graph[GEEdge]
    edges : seq[tuple[x : int , y : int]]

proc newGraph*[E](n : int) : Graph[E] =
  ## create n size new Graph.
  var g : Graph[E] = newSeqWith(n , newSeq[E](0))
  return g

proc size*[E](g : Graph[E]) : int =
  ## size of Graph
  return g.len

proc initGE[E](g : Graph[E]) : Edm =
  var edm : Edm
  edm.mate = newSeqWith(g.size + 1 , 0)
  edm.label = newSeqWith(g.size + 1, -1)
  edm.first = newSeqWith(g.size + 1,0)
  edm.g = newGraph[GEEdge](g.size + 1)
  edm.edges = @[]
  var cnt = g.size + 1 
  for i in 0..<g.size:
    for e in g[i]:
      edm.g[i + 1].add(GEEdge(to : e.to + 1 , num: cnt))
      edm.edges.add((i + 1 , e.to + 1))
      inc(cnt)
  return edm

proc eval_first(edm : var Edm , x : int) : int =
  if edm.label[edm.first[x]] < 0:
    # nonouter
    return edm.first[x]
  else:
    # outer -> next
    edm.first[x] = eval_first(edm , edm.first[x])
    return edm.first[x]

proc rematch(edm : var Edm ; v , w : int) =
  var t = edm.mate[v]
  edm.mate[v] = w
  if edm.mate[t] != v: return
  if edm.label[v] <= edm.g.size:
    edm.mate[t] = edm.label[v]
    rematch(edm,edm.label[v] , t)
  else:
    var (x , y) = edm.edges[edm.label[v] - edm.g.size]
    rematch(edm , x , y)
    rematch(edm , y , x)
  return

proc assignLabel(edm : var Edm ; x , y , num : int) =
  # L0
  var
    r = edm.eval_first(x)
    s = edm.eval_first(y)
    join = 0
  if r == s: return
  edm.label[r] = -num
  edm.label[s] = -num
  while true:
    # L1
    if s != 0: swap(r , s)
    # L2
    r = edm.eval_first(edm.label[edm.mate[r]])
    if edm.label[r] == -num: 
      join = r
      break
    edm.label[r] = -num
  # L3 L4
  var v = edm.first[x]
  while v != join:
    edm.label[v] = num
    edm.first[v] = join
    v = edm.first[edm.label[edm.mate[v]]]
  v = edm.first[y]
  while v != join:
    edm.label[v] = num
    edm.first[v] = join
    v = edm.first[edm.label[edm.mate[v]]]
  # L5
  return

proc augument_check(edm : var Edm , u : int) : bool =
  edm.first[u] = 0
  edm.label[u] = 0
  var que = initQueue[int]()
  que.enqueue(u)
  while que.len > 0:
    var x = que.dequeue
    # E3
    for e in edm.g[x]:
      var y = e.to
      # E4
      if edm.mate[y] == 0 and y != u:
        edm.mate[y] = x
        rematch(edm , x , y)
        return true
      # E5
      elif edm.label[y] >= 0:
        assignLabel(edm , x , y ,e.num)
      # E6
      elif edm.label[edm.mate[y]] < 0:
        edm.label[edm.mate[y]] = x
        edm.first[edm.mate[y]] = y
  return false


proc GarbowEdmonds*[E](g : Graph[E]) : seq[tuple[x : int , y : int]] =
  # E0
  var edm = g.initGE()
  var N = g.size

  # E1
  for i in 1..N:
    if edm.mate[i] != 0: continue
    if augument_check(edm , i):
      # E7
      edm.label[0] = -1
      for j in 1..N:
        if edm.label[i] >= 0:
          edm.label[i] = -1
          edm.label[edm.mate[i]] = -1
  var ans : seq[tuple[x : int , y : int]] = @[]
  for i in 1..N:
    if i < edm.mate[i]:
      ans.add((i , edm.mate[i]))
  return ans

import algorithm, tables, sets, lists, queues, intsets, critbits, sequtils, strutils, math, future
 
var input : seq[string] = @[]
var in_cnt = 0
 
proc gs() : string =
  if input.len == in_cnt:
    in_cnt = 0
    input = stdin.readline.split
  in_cnt += 1
  return input[in_cnt - 1]
 
proc gi() : int =
  return gs().parseInt
proc gf() : float =
  return gs().parseFloat
 
var N = gi()
 
var
  a = newSeq[int](N)
  b = a
  c = a
  d = a
for i in 0..<N:
  a[i] = gi()
  b[i] = gi()
for i in 0..<N:
  c[i] = gi()
  d[i] = gi()
 
var g = newGraph[Edge](N * 2)
 
for i in 0..<N:
  for j in 0..<N:
    if a[i] < c[j] and b[i] < d[j]:
      g[j + N].add(Edge(to : i))
      g[i].add(Edge(to : j + N))
      
echo g.GarbowEdmonds().len


Compiler output:
a.cc:4:5: error: stray '##' in program
    4 |     ## Edge Object , edit this to add more information like distance.
      |     ^~
a.cc:10:5: error: stray '##' in program
   10 |     ## Graph Object.
      |     ^~
a.cc:19:3: error: stray '##' in program
   19 |   ## create n size new Graph.
      |   ^~
a.cc:24:3: error: stray '##' in program
   24 |   ## size of Graph
      |   ^~
a.cc:33:15: error: stray '@' in program
   33 |   edm.edges = @[]
      |               ^
a.cc:35:12: error: too many decimal points in number
   35 |   for i in 0..<g.size:
      |            ^~~
a.cc:44:7: error: invalid preprocessing directive #nonouter
   44 |     # nonouter
      |       ^~~~~~~~
a.cc:47:7: error: invalid preprocessing directive #outer
   47 |     # outer -> next
      |       ^~~~~
a.cc:65:5: error: invalid preprocessing directive #L0
   65 |   # L0
      |     ^~
a.cc:74:7: error: invalid preprocessing directive #L1
   74 |     # L1
      |       ^~
a.cc:76:7: error: invalid preprocessing directive #L2
   76 |     # L2
      |       ^~
a.cc:82:5: error: invalid preprocessing directive #L3
   82 |   # L3 L4
      |     ^~
a.cc:93:5: error: invalid preprocessing directive #L5
   93 |   # L5
      |     ^~
a.cc:103:7: error: invalid preprocessing directive #E3
  103 |     # E3
      |       ^~
a.cc:106:9: error: invalid preprocessing directive #E4
  106 |       # E4
      |         ^~
a.cc:111:9: error: invalid preprocessing directive #E5
  111 |       # E5
      |         ^~
a.cc:114:9: error: invalid preprocessing directive #E6
  114 |       # E6
      |         ^~
a.cc:122:5: error: invalid preprocessing directive #E0
  122 |   # E0
      |     ^~
a.cc:126:5: error: invalid preprocessing directive #E1
  126 |   # E1
      |     ^~
a.cc:127:12: error: too many decimal points in number
  127 |   for i in 1..N:
      |            ^~~~
a.cc:130:9: error: invalid preprocessing directive #E7
  130 |       # E7
      |         ^~
a.cc:132:16: error: too many decimal points in number
  132 |       for j in 1..N:
      |                ^~~~
a.cc:136:45: error: stray '@' in program
  136 |   var ans : seq[tuple[x : int , y : int]] = @[]
      |                                             ^
a.cc:137:12: error: too many decimal points in number
  137 |   for i in 1..N:
      |            ^~~~
a.cc:144:27: error: stray '@' in program
  144 | var input : seq[string] = @[]
      |                           ^
a.cc:166:10: error: too many decimal points in number
  166 | for i in 0..<N:
      |          ^~~
a.cc:169:10: error: too many decimal points in number
  169 | for i in 0..<N:
      |          ^~~
a.cc:175:10: error: too many decimal points in number
  175 | for i in 0..<N:
      |          ^~~
a.cc:176:12: error: too many decimal points in number
  176 |   for j in 0..<N:
      |            ^~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sequtils , queues
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:51:30: error: 'v' does not name a type
   51 | proc rematch(edm : var Edm ; v , w : int) =
      |                              ^
a.cc:64:34: error: 'x' does not name a type
   64 | proc assignLabel(edm : var Edm ; x , y , num : int) =
      |                                  ^