Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <array>
using namespace std;

int main() {
  int N,M;
  cin >> N >> M;
  vector<array<int,2>> DAT;
  vector<int> C;
  vector<vector<int>> V;
  for (int i=0; i<M; i++) {
    int pi,yi;
    cin >> pi >> yi;
    auto itr = find(C.begin(), C.end(), pi);
    if( itr != C.end() ) {
      V[itr - C.begin()].push_back(yi);
    } else {
      C.push_back(pi);
      vector<int> vtmp(1,yi);
      V.push_back(vtmp);
    }
    array<int,2> dtmp{pi,yi};
    DAT.push_back(dtmp);
  }
  for (int i=0; i<V.size(); i++) {
    sort(V[i].begin(), V[i].end());
  }
  for (int i=0; i<M; i++) {
    int num;
    auto itr = find(C.begin(), C.end(), DAT[i][0]);
    if( itr != C.end() ) {
      int k = itr - C.begin();
      auto jtr = find(V[k].begin(), V[k].end(), DAT[i][1]);
      num = jtr - V[k].begin()+1;
    }
    cout << setfill('0') << right << setw(6) << DAT[i][0] << setfill('0') << right << setw(6) << num << endl;
  }


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   16 |     auto itr = find(C.begin(), C.end(), pi);
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
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:16:20: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   16 |     auto itr = find(C.begin(), C.end(), pi);
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:28:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   28 |     sort(V[i].begin(), V[i].end());
      |     ^~~~
      |     short
a.cc:32:20: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, std::array<int, 2>::value_type&)'
   32 |     auto itr = find(C.begin(), C.end(), DAT[i][0]);
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:32:20: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   32 |     auto itr = find(C.begin(), C.end(), DAT[i][0]);
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:35:22: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, std::array<int, 2>::value_type&)'
   35 |       auto jtr = find(V[k].begin(), V[k].end(), DAT[i][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:22: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   35 |       auto jtr = find(V[k].begin(), V[k].end(), DAT[i][1]);
      |                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~