Language: C++

#include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;

int main(){
    int N;
    cin >> N;
    int a[N+10], b[N+10], c[N+10], d[N+10];
    map<int, int> red, blue;
    for(int i = 0; i < N; ++i){
        cin >> a[i] >> b[i];
        red[a[i]] = b[i];
    }
    for(int i = 0; i < N; ++i){
        cin >> c[i] >> d[i];
        blue[c[i]] = d[i];
    }
    int count = 0;
    vector<int> vr, vb;
    for (const auto& [bkey, bvalue] : blue){
        int tmp = -1;
        for(const auto& [rkey, rvalue] : red){
            if(rkey < bkey && rvalue < bvalue && find(vr.begin(), vr.end(), rvalue) == vr.end() && find(vb.begin(), vb.end(), bkey) == vb.end() && rvalue > tmp) tmp = rvalue;
        }
        if (tmp != -1){
            count++;
            //cout << tmp << " " << bkey << bvalue << endl;
            vr.push_back(tmp);
            vb.push_back(bkey);
        }
    }
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:54: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, std::tuple_element<1, const std::pair<const int, int> >::type&)'
   25 |             if(rkey < bkey && rvalue < bvalue && find(vr.begin(), vr.end(), rvalue) == vr.end() && find(vb.begin(), vb.end(), bkey) == vb.end() && rvalue > tmp) tmp = rvalue;
      |                                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:25:54: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   25 |             if(rkey < bkey && rvalue < bvalue && find(vr.begin(), vr.end(), rvalue) == vr.end() && find(vb.begin(), vb.end(), bkey) == vb.end() && rvalue > tmp) tmp = rvalue;
      |                                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:104: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, std::tuple_element<0, const std::pair<const int, int> >::type&)'
   25 |             if(rkey < bkey && rvalue < bvalue && find(vr.begin(), vr.end(), rvalue) == vr.end() && find(vb.begin(), vb.end(), bkey) == vb.end() && rvalue > tmp) tmp = rvalue;
      |                                                                                                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:25:104: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   25 |             if(rkey < bkey && rvalue < bvalue && find(vr.begin(), vr.end(), rvalue) == vr.end() && find(vb.begin(), vb.end(), bkey) == vb.end() && rvalue > tmp) tmp = rvalue;
      |                                                                                                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~