Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int N, M;
	cin >> N >> M;

	tuple<int,long long,int> ID[M];
	for (int i = 0; i < M; i++) {
		long long p, y;
		cin >> p >> y;
		ID.make_tuple(y, p, i);
	}
	sort(ID, ID + M);
	int P[N] = {};
	for (int i = 0; i < M; i++) {
		long long a, b, c;
		tie(a, b, c) = ID;
		P[b]++;
		cout << setw(6) <<setfill(0)<<p;
		cout << setw(6) << setfill(0) << P[b] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: request for member 'make_tuple' in 'ID', which is of non-class type 'std::tuple<int, long long int, int> [M]'
   11 |                 ID.make_tuple(y, p, i);
      |                    ^~~~~~~~~~
a.cc:17:32: error: no match for 'operator=' (operand types are 'std::tuple<long long int&, long long int&, long long int&>' and 'std::tuple<int, long long int, int> [M]')
   17 |                 tie(a, b, c) = ID;
      |                                ^~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/tuple:1930:9: note: candidate: 'template<class ... _UElements> std::__enable_if_t<((bool)__assignable<const _UElements& ...>()), std::tuple< <template-parameter-1-1> >&> std::tuple< <template-parameter-1-1> >::operator=(const std::tuple<_Args1 ...>&) [with _UElements = {_UElements ...}; _Elements = {long long int&, long long int&, long long int&}]'
 1930 |         operator=(const tuple<_UElements...>& __in)
      |         ^~~~~~~~
/usr/include/c++/14/tuple:1930:9: note:   template argument deduction/substitution failed:
a.cc:17:32: note:   mismatched types 'const std::tuple<_UTypes ...>' and 'std::tuple<int, long long int, int> [M]'
   17 |                 tie(a, b, c) = ID;
      |                                ^~
/usr/include/c++/14/tuple:1940:9: note: candidate: 'template<class ... _UElements> std::__enable_if_t<((bool)__assignable<_UElements ...>()), std::tuple< <template-parameter-1-1> >&> std::tuple< <template-parameter-1-1> >::operator=(std::tuple<_Args1 ...>&&) [with _UElements = {_UElements ...}; _Elements = {long long int&, long long int&, long long int&}]'
 1940 |         operator=(tuple<_UElements...>&& __in)
      |         ^~~~~~~~
/usr/include/c++/14/tuple:1940:9: note:   template argument deduction/substitution failed:
a.cc:17:32: note:   mismatched types 'std::tuple<_UTypes ...>' and 'std::tuple<int, long long int, int> [M]'
   17 |                 tie(a, b, c) = ID;
      |                                ^~
/usr/include/c++/14/tuple:1907:7: note: candidate: 'std::tuple< <template-parameter-1-1> >& std::tuple< <template-parameter-1-1> >::operator=(std::__conditional_t<((bool)__assignable<const _Elements& ...>()), const std::tuple< <template-parameter-1-1> >&, const std::__nonesuch&>) [with _Elements = {long long int&, long long int&, long long int&}; std::__conditional_t<((bool)__assignable<const _Elements& ...>()), const std::tuple< <template-parameter-1-1> >&, const std::__nonesuch&> = const std::tuple<long long int&, long long int&, long long int&>&]'
 1907 |       operator=(__conditional_t<__assignable<const _Elements&...>(),
      |       ^~~~~~~~
/usr/include/c++/14/tuple:1909:52: note:   no known conversion for argument 1 from 'std::tuple<int, long long int, int> [M]' to 'std::__conditional_t<true, const std::tuple<long long int&, long long int&, long long int&>&, const std::__nonesuch&>' {aka 'const std::tuple<long long int&, long long int&, long long int&>&'}
 1907 |       operator=(__conditional_t<__assignable<const _Elements&...>(),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1908 |                                 const tuple&,
      |                                 ~~~~~~~~~~~~~       
 1909 |                                 const __nonesuch&> __in)
      |                                 ~~~~~~~~~~~~~~~~~~~^~~~
/usr/include/c++/14/tuple:1918:7: note: candidate: 'std::tuple< <template-parameter-1-1> >& std::tuple< <template-parameter-1-1> >::operator=(std::__conditional_t<((bool)__assignable<_Elements ...>()), std::tuple< <template-parameter-1-1> >&&, std::__nonesuch&&>) [with _Elements = {long long int&, long long int&, long long int&}; std::__conditional_t<((bool)__assignable<_Elements ...>()), std::tuple< <template-parameter-1-1> >&&, std::__nonesuch&&> = std::tuple<long long int&, long long int&, long long int&>&&]'
 1918 |       operator=(__conditional_t<__assignable<_Elements...>(),
      |       ^~~~~~~~
/usr/include/c++/14/tuple:1920:47: note:   no known conversion for argument 1 from 'std::tuple<int, long long int, int> [M]' to 'std::__conditional_t<true, std::tuple<long long int&, long long int&, long long int&>&&, std::__nonesuch&&>' {aka 'std::tuple<long long int&, long long int&, long long int&>&&'}
 1918 |       operator=(__conditional_t<__assignable<_Elements...>(),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1919 |                                 tuple&&,
      |                                 ~~~~~~~~       
 1920 |                                 __nonesuch&&> __in)
      |                                 ~~~~~~~~~~~~~~^~~~
a.cc:19:33: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::_Setfill<int>')
   19 |                 cout << setw(6) <<setfill(0)<<p;
      |                 ~~~~~~~~~~~~~~~ ^~~~~~~~~~~~
      |                      |                   |
      |                      |                   std::_Setfill<int>
      |                      std::basic_ostream<char>
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  116 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |       ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note:   no known conversion for argument 1 from 'std::_Setfill<int>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
  116 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
  125 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note:   no known conversion for argument 1 from 'std::_Setfill<int>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
  125 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  135 |       operator<<(ios_base& (*__pf) (ios_base&))
      |       ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note:   no known conversion for argument 1 from 'std::_Setfill<int>' to 'std::ios_base& (*)(std::ios_base&)'
  135 |       operator<<(ios_base& (*__pf) (ios_base&))
      |                  ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  174 |       operator<<(long __n)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note:   no known conversion for argument 1 from 'std::_Setfill<int>' to 'long int'
  174 |       operator<<(long __n)
      |                  ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  178 |       operator<<(unsigned long __n)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note:   no known conversion for argument 1 from 'std::_Setfill<int>' to 'long unsigned int'
  178 |       operator<<(unsigned long __n)
      |                  ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  182 |       operator<<(bool __n)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note:   no known conversion for argument 1 from 'std::_Setfill<int>' to 'bool'
  182 |       operator<<(bool __n)
      |                  ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
   96 |     basic_ostream<_CharT, _Traits>::
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note:   no known conversion for argument 1 from 'std::_Setfill<int>' to 'short int'
   97 |     operator<<(short __n)
      |                ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  189 |       operator<<(unsigned short __n)
      |       ^~~~~~~~
/usr/in