Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <tuple>
#include <utility>
#include <iomanip>
using namespace std;
typedef long long ll;
int main(){
    ll n,m,rem,c=1;
    cin>>n>>m;
    vector<tuple<ll,ll,ll>>id(m);
    for(int i=0;i<m;i++){
        ll p,y;
        cin>>p>>y;
        id[i]=make_pair(p,y,i);
    }
    sort(id.begin(),id.end());
    rem=id[0].first/num;
    for(int i=0;i<m;i++){
        ll k=id[i].first/num;
        if(k==rem){
            id[i].first=(id[i].first/num)*num+c;
            c++;
        }else{
            c=1;
            id[i].first=(id[i].first/num)*num+c;
            c++;
            rem=id[i].first/num;
        }
    }
    for(int i=0;i<m;i++){
        swap(id[i].first,id[i].second);
    }
    sort(id.begin(),id.end());
    for(int i=0;i<m;i++){
        cout<<setw(12)<<setfill('0')<<id[i].second<<"\n";
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: no matching function for call to 'make_pair(ll&, ll&, int&)'
   17 |         id[i]=make_pair(p,y,i);
      |               ~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidate: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note:   candidate expects 2 arguments, 3 provided
a.cc:20:15: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'first'
   20 |     rem=id[0].first/num;
      |               ^~~~~
a.cc:20:21: error: 'num' was not declared in this scope; did you mean 'enum'?
   20 |     rem=id[0].first/num;
      |                     ^~~
      |                     enum
a.cc:22:20: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'first'
   22 |         ll k=id[i].first/num;
      |                    ^~~~~
a.cc:24:19: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'first'
   24 |             id[i].first=(id[i].first/num)*num+c;
      |                   ^~~~~
a.cc:24:32: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'first'
   24 |             id[i].first=(id[i].first/num)*num+c;
      |                                ^~~~~
a.cc:28:19: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'first'
   28 |             id[i].first=(id[i].first/num)*num+c;
      |                   ^~~~~
a.cc:28:32: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'first'
   28 |             id[i].first=(id[i].first/num)*num+c;
      |                                ^~~~~
a.cc:30:23: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'first'
   30 |             rem=id[i].first/num;
      |                       ^~~~~
a.cc:34:20: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'first'
   34 |         swap(id[i].first,id[i].second);
      |                    ^~~~~
a.cc:34:32: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'second'
   34 |         swap(id[i].first,id[i].second);
      |                                ^~~~~~
a.cc:38:45: error: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<long long int, long long int, long long int> >, std::tuple<long long int, long long int, long long int> >::value_type' {aka 'class std::tuple<long long int, long long int, long long int>'} has no member named 'second'
   38 |         cout<<setw(12)<<setfill('0')<<id[i].second<<"\n";
      |                                             ^~~~~~