Language: C++

#include <iostream>
#include <queue>
#include <string>
#include <map>

using namespace std;
typedef pair<int,int> mypair;

int main()
{
	int H,W,N,c;
	char cmap[1002][1002];
	queue<mypair> que;
	map<char,mypair>::iterator it;
	map<char,mypair> gole;
	mypair temp,start;

	while(cin >> H >> W >> N && H || W || N){
		for(int i = 0; i <= W+1; i++){
			cmap[0][i] = 'X';
			cmap[H+1][i] = 'X';
		}
		for(int i = 0; i <= H+1; i++){
			cmap[i][0] = 'X';
			cmap[i][W+1] = 'X';
		}

		for(int i = 1; i <= H; i++){
			for(int j = 1; j <= W; j++){
				cin >> cmap[i][j];
				if(cmap[i][j] >= '1' && cmap[i][j] <= '9'){
					temp.first = i;
					temp.second = j;
					gole.insert(make_pair(cmap[i][j],temp));
				}
				else if(cmap[i][j] == 'S'){
					start.first = i;
					start.second = j;
				}
			}
		}

		gole.insert('0',start);
		for(it = gole.begin(); it != gole.end(); it++){
			que.push(it->second);
			while(!que.empty()){
				
			}
		}

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:28: error: no matching function for call to 'std::map<char, std::pair<int, int> >::insert(char, mypair&)'
   43 |                 gole.insert('0',start);
      |                 ~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/map:63,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_map.h:847:9: note: candidate: 'template<class _Pair> std::__enable_if_t<((bool)std::is_constructible<std::pair<const _Key, _Tp>, _Pair>::value), std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> > std::map<_Key, _Tp, _Compare, _Alloc>::insert(_Pair&&) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >]'
  847 |         insert(_Pair&& __x)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_map.h:847:9: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:924: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<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, _Pair&&) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >]'
  924 |         insert(const_iterator __position, _Pair&& __x)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_map.h:924:9: note:   template argument deduction/substitution failed:
a.cc:43:29: note:   cannot convert ''0'' (type 'char') to type 'std::map<char, std::pair<int, int> >::const_iterator' {aka 'std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::const_iterator'}
   43 |                 gole.insert('0',start);
      |                             ^~~
/usr/include/c++/14/bits/stl_map.h:942:9: note: candidate: 'template<class _InputIterator> void std::map<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >]'
  942 |         insert(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_map.h:942:9: note:   template argument deduction/substitution failed:
a.cc:43:28: note:   deduced conflicting types for parameter '_InputIterator' ('char' and 'std::pair<int, int>')
   43 |                 gole.insert('0',start);
      |                 ~~~~~~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:661:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::insert_return_type std::map<_Key, _Tp, _Compare, _Alloc>::insert(node_type&&) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >; insert_return_type = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::insert_return_type; node_type = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::node_type]'
  661 |       insert(node_type&& __nh)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_map.h:661:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:666:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, node_type&&) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >; iterator = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::iterator; const_iterator = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::const_iterator; node_type = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::node_type]'
  666 |       insert(const_iterator __hint, node_type&& __nh)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_map.h:666:29: note:   no known conversion for argument 1 from 'char' to 'std::map<char, std::pair<int, int> >::const_iterator' {aka 'std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::const_iterator'}
  666 |       insert(const_iterator __hint, node_type&& __nh)
      |              ~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_map.h:834:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const value_type&) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other = std::allocator<std::pair<const char, std::pair<int, int> > >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> > = __gnu_cxx::__alloc_traits<std::allocator<std::pair<const char, std::pair<int, int> > >, std::pair<const char, std::pair<int, int> > >::rebind<std::pair<const char, std::pair<int, int> > >; typename _Allocator::value_type = std::pair<const char, std::pair<int, int> >; value_type = std::pair<const char, std::pair<int, int> >]'
  834 |       insert(const value_type& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_map.h:834:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:841:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(value_type&&) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other = std::allocator<std::pair<const char, std::pair<int, int> > >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> > = __gnu_cxx::__alloc_traits<std::allocator<std::pair<const char, std::pair<int, int> > >, std::pair<const char, std::pair<int, int> > >::rebind<std::pair<const char, std::pair<int, int> > >; typename _Allocator::value_type = std::pair<const char, std::pair<int, int> >; value_type = std::pair<const char, std::pair<int, int> >]'
  841 |       insert(value_type&& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_map.h:841:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:879:7: note: candidate: 'void std::map<_Key, _Tp, _Compare, _Alloc>::insert(std::initializer_list<std::pair<const _Key, _Tp> >) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >]'
  879 |       insert(std::initializer_list<value_type> __list)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_map.h:879:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:909:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, const value_type&) [with _Key = char; _Tp = std::pair<int, int>; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, std::pair<int, int> > >; iterator = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::iterator; const_iterator = std::_Rb_tree<char, std::pair<const char, std::pair<int, int> >, std::_Select1st<std::pair<const char, std::pair<int, int> > >, std::less<char>, std::allocator<std::pair<const char, std::pair<int, int> > > >::const_iterator; value_type = std::pair<const char, std::pai