Language: C++

#include<bits/stdc++.h>                          
using namespace std;
int n,ans;
struct cam{
	int a;
	int b;
}c[105];
struct cbm{
	int x;
	int y;
}d[105];
bool camp(int g,int h)
{
	if(g.a==h.a) return g.b>h.b;
	else return g.a>h.a;
}
bool cbmp(int g,int h)
{
	if(g.x==h.x) return g.y>h.y;
	else return g.x>h.x;
}
int main(){
    cin>>n;
    for(int i=1;i<=n;i++) cin>>c[i].a>>c[i].b;
    sort(c+1,c+1+n,camp);
    for(int i=1;i<=n;i++) cin>>d[i].x>>d[i].y;
    sort(d+1,d+1+n,cbmp);
    for(int i=1;i<=n;i++)
        if(c[i].a<=d[i].x&&c[i].b<=d[i].y) ans++;
    cout<<ans;
    return 0;
}
//68871358
//76140264

Compiler output:
a.cc: In function 'bool camp(int, int)':
a.cc:14:14: error: request for member 'a' in 'g', which is of non-class type 'int'
   14 |         if(g.a==h.a) return g.b>h.b;
      |              ^
a.cc:14:19: error: request for member 'a' in 'h', which is of non-class type 'int'
   14 |         if(g.a==h.a) return g.b>h.b;
      |                   ^
a.cc:14:31: error: request for member 'b' in 'g', which is of non-class type 'int'
   14 |         if(g.a==h.a) return g.b>h.b;
      |                               ^
a.cc:14:35: error: request for member 'b' in 'h', which is of non-class type 'int'
   14 |         if(g.a==h.a) return g.b>h.b;
      |                                   ^
a.cc:15:23: error: request for member 'a' in 'g', which is of non-class type 'int'
   15 |         else return g.a>h.a;
      |                       ^
a.cc:15:27: error: request for member 'a' in 'h', which is of non-class type 'int'
   15 |         else return g.a>h.a;
      |                           ^
a.cc: In function 'bool cbmp(int, int)':
a.cc:19:14: error: request for member 'x' in 'g', which is of non-class type 'int'
   19 |         if(g.x==h.x) return g.y>h.y;
      |              ^
a.cc:19:19: error: request for member 'x' in 'h', which is of non-class type 'int'
   19 |         if(g.x==h.x) return g.y>h.y;
      |                   ^
a.cc:19:31: error: request for member 'y' in 'g', which is of non-class type 'int'
   19 |         if(g.x==h.x) return g.y>h.y;
      |                               ^
a.cc:19:35: error: request for member 'y' in 'h', which is of non-class type 'int'
   19 |         if(g.x==h.x) return g.y>h.y;
      |                                   ^
a.cc:20:23: error: request for member 'x' in 'g', which is of non-class type 'int'
   20 |         else return g.x>h.x;
      |                       ^
a.cc:20:27: error: request for member 'x' in 'h', which is of non-class type 'int'
   20 |         else return g.x>h.x;
      |                           ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = cam*; _Iterator2 = cam*; _Compare = bool (*)(int, int)]':
/usr/include/c++/14/bits/stl_algo.h:1777:14:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cam*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1777 |           if (__comp(__i, __first))
      |               ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cam*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1817 |           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cam*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1908 |           std::__final_insertion_sort(__first, __last, __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = cam*; _Compare = bool (*)(int, int)]'
 4805 |       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:9:   required from here
   25 |     sort(c+1,c+1+n,camp);
      |     ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: cannot convert 'cam' to 'int' in argument passing
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = cbm*; _Iterator2 = cbm*; _Compare = bool (*)(int, int)]':
/usr/include/c++/14/bits/stl_algo.h:1777:14:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cbm*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1777 |           if (__comp(__i, __first))
      |               ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cbm*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1817 |           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cbm*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1908 |           std::__final_insertion_sort(__first, __last, __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = cbm*; _Compare = bool (*)(int, int)]'
 4805 |       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:27:9:   required from here
   27 |     sort(d+1,d+1+n,cbmp);
      |     ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: cannot convert 'cbm' to 'int' in argument passing
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = cam; _Iterator = cam*; _Compare = bool (*)(int, int)]':
/usr/include/c++/14/bits/stl_algo.h:1757:20:   required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = cam*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool (*)(int, int)>]'
 1757 |       while (__comp(__val, __next))
      |              ~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1785:36:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cam*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1785 |             std::__unguarded_linear_insert(__i,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
 1786 |                                 __gnu_cxx::__ops::__val_comp_iter(__comp));
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cam*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1817 |           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cam*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1908 |           std::__final_insertion_sort(__first, __last, __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = cam*; _Compare = bool (*)(int, int)]'
 4805 |       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:9:   required from here
   25 |     sort(c+1,c+1+n,camp);
      |     ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:240:30: error: cannot convert 'cam' to 'int' in argument passing
  240 |         { return bool(_M_comp(__val, *__it)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = cbm; _Iterator = cbm*; _Compare = bool (*)(int, int)]':
/usr/include/c++/14/bits/stl_algo.h:1757:20:   required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = cbm*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool (*)(int, int)>]'
 1757 |       while (__comp(__val, __next))
      |              ~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1785:36:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cbm*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1785 |             std::__unguarded_linear_insert(__i,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
 1786 |                                 __gnu_cxx::__ops::__val_comp_iter(__comp));
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = cbm*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(int, int)>]'
 1817 |           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |           ~~~~~~~~~~~~~~~~~~~