Language: C++

#include<iostream>
#include<map>
#include<string>
#include<vector>
#include<stdio.h>
#include<functional>


using namespace std;

int main(){

    int N;
    string S;
    int P;
    multimap<string,std::greater<int> > all;
    map<int,int> all2;
    cin >>N;

    for(int i=0;i<N;i++){
        cin>>S>>P;
        all.insert(make_pair(S,P));
        all2.insert(make_pair(P,i+1));

    }

    for(auto it=all.begin();it!=all.end();it++){
        
        cout<<all2[it->second]<<endl;
    }
 
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: no matching function for call to 'std::multimap<std::__cxx11::basic_string<char>, std::greater<int> >::insert(std::pair<std::__cxx11::basic_string<char>, int>)'
   22 |         all.insert(make_pair(S,P));
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/map:64,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_multimap.h:557:9: note: candidate: 'template<class _Pair> std::__enable_if_t<((bool)std::is_constructible<std::pair<const _Key, _Tp>, _Pair>::value), typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator> std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(_Pair&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::greater<int>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >]'
  557 |         insert(_Pair&& __x)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_multimap.h:557:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::__enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >]':
/usr/include/c++/14/bits/stl_multimap.h:557:2:   required by substitution of 'template<class _Pair> std::__enable_if_t<((bool)std::is_constructible<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >, _Pair>::value), std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > > > std::multimap<std::__cxx11::basic_string<char>, std::greater<int> >::insert(_Pair&&) [with _Pair = std::pair<std::__cxx11::basic_string<char>, int>]'
a.cc:22:19:   required from here
   22 |         all.insert(make_pair(S,P));
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/type_traits:138:11: error: no type named 'type' in 'struct std::enable_if<false, std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > > >'
  138 |     using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
      |           ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_multimap.h:600:9: note: candidate: 'template<class _Pair> std::__enable_if_t<((bool)std::is_constructible<std::pair<const _Key, _Tp>, _Pair&&>::value), typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator> std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, _Pair&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::greater<int>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >]'
  600 |         insert(const_iterator __position, _Pair&& __x)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_multimap.h:600:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multimap.h:619:9: note: candidate: 'template<class _InputIterator> void std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::greater<int>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >]'
  619 |         insert(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_multimap.h:619:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multimap.h:545:7: note: candidate: 'std::multimap<_Key, _Tp, _Compare, _Alloc>::iterator std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::greater<int>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >; iterator = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > > >::iterator; value_type = std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >]'
  545 |       insert(const value_type& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_multimap.h:545:32: note:   no known conversion for argument 1 from 'std::pair<std::__cxx11::basic_string<char>, int>' to 'const std::multimap<std::__cxx11::basic_string<char>, std::greater<int> >::value_type&' {aka 'const std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >&'}
  545 |       insert(const value_type& __x)
      |              ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_multimap.h:552:7: note: candidate: 'std::multimap<_Key, _Tp, _Compare, _Alloc>::iterator std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(value_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::greater<int>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >; iterator = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > > >::iterator; value_type = std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >]'
  552 |       insert(value_type&& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_multimap.h:552:27: note:   no known conversion for argument 1 from 'std::pair<std::__cxx11::basic_string<char>, int>' to 'std::multimap<std::__cxx11::basic_string<char>, std::greater<int> >::value_type&&' {aka 'std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >&&'}
  552 |       insert(value_type&& __x)
      |              ~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_multimap.h:585:7: note: candidate: 'std::multimap<_Key, _Tp, _Compare, _Alloc>::iterator std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, const value_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::greater<int>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >; iterator = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > > >::iterator; const_iterator = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > > >::const_iterator; value_type = std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >]'
  585 |       insert(const_iterator __position, const value_type& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_multimap.h:585:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multimap.h:595:7: note: candidate: 'std::multimap<_Key, _Tp, _Compare, _Alloc>::iterator std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, value_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::greater<int>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >; iterator = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > > >::iterator; const_iterator = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > > >::const_iterator; value_type = std::pair<const std::__cxx11::basic_string<char>, std::greater<int> >]'
  595 |       insert(const_iterator __position, value_type&& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_multimap.h:595:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multimap.h:631:7: note: candidate: 'void std::multimap<_Key, _Tp, _Compare, _Alloc>::insert(std::initializer_list<std::pair<const _Key, _Tp> >) [with _Key = std::__cxx11::basic_string<char>; _Tp = std::greater<int>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::greater<int> > >]'
  631 |       insert(initializer_list<value_type> __l)