Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
int N, M;
vector<int> count;
vector<pair<int,int>> id;
typedef pair<int,pair<int, int>> tp;
vector<tp> P;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N >> M;
	REP(i, N) {
		count.push_back(1);
	}
	REP(i, M) {
		int p, y;
		cin >> p >> y;	
    id.push_back(make_pair(p,0));
	P.push_back(make_pair(y,make_pair(p, i)));

	}
	sort ( P.begin(), P.end());

	REP(i, M) {
		id[P[i].second.second].second = count[P[i].second.first - 1]++;
	}

	REP(i, M) {
		printf("%06d%06d\n", id.first, id.second);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: reference to 'count' is ambiguous
   16 |                 count.push_back(1);
      |                 ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:6:13: note:                 'std::vector<int> count'
    6 | vector<int> count;
      |             ^~~~~
a.cc:28:49: error: reference to 'count' is ambiguous
   28 |                 id[P[i].second.second].second = count[P[i].second.first - 1]++;
      |                                                 ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:6:13: note:                 'std::vector<int> count'
    6 | vector<int> count;
      |             ^~~~~
a.cc:32:41: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   32 |                 printf("%06d%06d\n", id.first, id.second);
      |                                         ^~~~~
a.cc:32:51: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   32 |                 printf("%06d%06d\n", id.first, id.second);
      |                                                   ^~~~~~