Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define INF 1e9;
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> p(m), y(m);
    vector<int> work(n+1);
    rep(i, m) {
        cin >> p[i] >> y[i];
        work[p[i]].push_back(y[i]);
    }

    rep(i, n) {
        sort(work[i+1].begin(), work[i+1].end());
    }

    rep(i, m) {
        printf("%012lld\n", ll(p[i])*1000000 + int(lower_bound(all(work[p[i]]), y[i]) - work[p[i]].begin()) + 1);
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: request for member 'push_back' in 'work.std::vector<int>::operator[](((std::vector<int>::size_type)p.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   17 |         work[p[i]].push_back(y[i]);
      |                    ^~~~~~~~~
a.cc:21:24: error: request for member 'begin' in 'work.std::vector<int>::operator[](((std::vector<int>::size_type)(i + 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   21 |         sort(work[i+1].begin(), work[i+1].end());
      |                        ^~~~~
a.cc:21:43: error: request for member 'end' in 'work.std::vector<int>::operator[](((std::vector<int>::size_type)(i + 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   21 |         sort(work[i+1].begin(), work[i+1].end());
      |                                           ^~~
a.cc:4:20: error: request for member 'begin' in 'work.std::vector<int>::operator[](((std::vector<int>::size_type)p.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
    4 | #define all(x) (x).begin(), (x).end()
      |                    ^~~~~
a.cc:25:64: note: in expansion of macro 'all'
   25 |         printf("%012lld\n", ll(p[i])*1000000 + int(lower_bound(all(work[p[i]]), y[i]) - work[p[i]].begin()) + 1);
      |                                                                ^~~
a.cc:4:33: error: request for member 'end' in 'work.std::vector<int>::operator[](((std::vector<int>::size_type)p.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
    4 | #define all(x) (x).begin(), (x).end()
      |                                 ^~~
a.cc:25:64: note: in expansion of macro 'all'
   25 |         printf("%012lld\n", ll(p[i])*1000000 + int(lower_bound(all(work[p[i]]), y[i]) - work[p[i]].begin()) + 1);
      |                                                                ^~~
a.cc:25:100: error: request for member 'begin' in 'work.std::vector<int>::operator[](((std::vector<int>::size_type)p.std::vector<int>::operator[](((std::vector<int>::size_type)i))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   25 |         printf("%012lld\n", ll(p[i])*1000000 + int(lower_bound(all(work[p[i]]), y[i]) - work[p[i]].begin()) + 1);
      |                                                                                                    ^~~~~