Language: C++

#include<iostream>
#include<vector>
#include<utility>
using namespace std;

int main(){
    while (1){
        int n;
        cin >> n;
        if (n == 0){
            break;
        }

        vector<pair<int, int> > gems(n);

        for (auto itr = gems.begin(); itr != gems.end(); ++itr){
            int x, y;
            cin >> x >> y;
            *itr = make_pair(x, y);
        }

        int m;
        cin >> m;

        pair<int, int> pos(10, 10);
        int cnt = 0;

        for (int i = 0; i < m; i++){
            char dir;
            int step;
            cin >> dir >> step;
            if (dir == 'N'){
                for (int j = 0; j < step; j++){
                    pos.second++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        cnt++;
                    }
                }
            }
            else if (dir == 'E'){
                for (int j = 0; j < step; j++){
                    pos.first++;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        cnt++;
                    }
                }
            }
            else if (dir == 'S'){
                for (int j = 0; j < step; j++){
                    pos.second--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        cnt++;
                    }
                }
            }
            else{
                for (int j = 0; j < step; j++){
                    pos.first--;
                    auto isGems = find(gems.cbegin(), gems.cend(), pos);
                    if (isGems != gems.cend()){
                        cnt++;
                    }
                }
            }
        }

        cout << ((cnt == n) ? "Yes" : "No") << endl;
    }


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:39: error: no matching function for call to 'find(std::vector<std::pair<int, int> >::const_iterator, std::vector<std::pair<int, int> >::const_iterator, std::pair<int, int>&)'
   35 |                     auto isGems = find(gems.cbegin(), gems.cend(), pos);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:35:39: note:   '__gnu_cxx::__normal_iterator<const std::pair<int, int>*, std::vector<std::pair<int, int> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   35 |                     auto isGems = find(gems.cbegin(), gems.cend(), pos);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:44:39: error: no matching function for call to 'find(std::vector<std::pair<int, int> >::const_iterator, std::vector<std::pair<int, int> >::const_iterator, std::pair<int, int>&)'
   44 |                     auto isGems = find(gems.cbegin(), gems.cend(), pos);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:44:39: note:   '__gnu_cxx::__normal_iterator<const std::pair<int, int>*, std::vector<std::pair<int, int> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   44 |                     auto isGems = find(gems.cbegin(), gems.cend(), pos);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:53:39: error: no matching function for call to 'find(std::vector<std::pair<int, int> >::const_iterator, std::vector<std::pair<int, int> >::const_iterator, std::pair<int, int>&)'
   53 |                     auto isGems = find(gems.cbegin(), gems.cend(), pos);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:53:39: note:   '__gnu_cxx::__normal_iterator<const std::pair<int, int>*, std::vector<std::pair<int, int> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   53 |                     auto isGems = find(gems.cbegin(), gems.cend(), pos);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:62:39: error: no matching function for call to 'find(std::vector<std::pair<int, int> >::const_iterator, std::vector<std::pair<int, int> >::const_iterator, std::pair<int, int>&)'
   62 |                     auto isGems = find(gems.cbegin(), gems.cend(), pos);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:62:39: note:   '__gnu_cxx::__normal_iterator<const std::pair<int, int>*, std::vector<std::pair<int, int> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   62 |                     auto isGems = find(gems.cbegin(), gems.cend(), pos);
      |                                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~