Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<functional>
#include<map>
#include<cmath>
#include<iomanip>

using namespace std;

typedef long long ll;

int main(){
    int n, m; cin >> n >> m;
    vector<int> p(100000), y(100000), num(100005);

    for(int i = 0; i < m; i++)
    {
        cin >> p[i] >> y[i];
        num[p[i]].push_back(y[i]);
    }

    for(int i = 0; i < n; i++)
    {
        //それぞれの県の中でソート
        //num[0]は無いので飛ばす
        sort(num[i + 1].begin(), num[i + 1].end()); 
    }
    
    for(int i = 0; i < m; i++)
    {
        cout << (ll)p[i] * 1000000 + (int)lower_bound(num[p[i]].begin(), num[p[i]].end(), y[i]) - num[p[i]].begin() + 1 << endl;
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: request for member 'push_back' in 'num.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'}
   21 |         num[p[i]].push_back(y[i]);
      |                   ^~~~~~~~~
a.cc:28:25: error: request for member 'begin' in 'num.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'}
   28 |         sort(num[i + 1].begin(), num[i + 1].end());
      |                         ^~~~~
a.cc:28:45: error: request for member 'end' in 'num.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'}
   28 |         sort(num[i + 1].begin(), num[i + 1].end());
      |                                             ^~~
a.cc:33:65: error: request for member 'begin' in 'num.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'}
   33 |         cout << (ll)p[i] * 1000000 + (int)lower_bound(num[p[i]].begin(), num[p[i]].end(), y[i]) - num[p[i]].begin() + 1 << endl;
      |                                                                 ^~~~~
a.cc:33:84: error: request for member 'end' in 'num.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'}
   33 |         cout << (ll)p[i] * 1000000 + (int)lower_bound(num[p[i]].begin(), num[p[i]].end(), y[i]) - num[p[i]].begin() + 1 << endl;
      |                                                                                    ^~~
a.cc:33:109: error: request for member 'begin' in 'num.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'}
   33 |         cout << (ll)p[i] * 1000000 + (int)lower_bound(num[p[i]].begin(), num[p[i]].end(), y[i]) - num[p[i]].begin() + 1 << endl;
      |                                                                                                             ^~~~~