Language: C++

#include<iostream>
#include<map>
#include<cmath>
using namespace std;
int main()
{
  map<char, int> M;
  int k;
  int a,b,c,d,e;
  string S = "abcde";
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
  cin >> e;
  M["a"] = a;
  M["b"] = b;
  M["c"] = c;
  M["d"] = d;
  M["e"] = e;
  for(char key : S){
    for(char  key_t : S){
      if(abs(M[key] - M[key_t]) > k){
        cout << ":(" << endl;
        break;
      }
    }
  }
  cout << "Yay!" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:4: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
   16 |   M["a"] = a;
      |    ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:16:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   16 |   M["a"] = a;
      |     ^~~
      |     |
      |     const char*
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:16:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   16 |   M["a"] = a;
      |     ^~~
      |     |
      |     const char*
a.cc:17:4: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
   17 |   M["b"] = b;
      |    ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   17 |   M["b"] = b;
      |     ^~~
      |     |
      |     const char*
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:17:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   17 |   M["b"] = b;
      |     ^~~
      |     |
      |     const char*
a.cc:18:4: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
   18 |   M["c"] = c;
      |    ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:18:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   18 |   M["c"] = c;
      |     ^~~
      |     |
      |     const char*
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:18:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   18 |   M["c"] = c;
      |     ^~~
      |     |
      |     const char*
a.cc:19:4: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
   19 |   M["d"] = d;
      |    ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:19:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   19 |   M["d"] = d;
      |     ^~~
      |     |
      |     const char*
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:19:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   19 |   M["d"] = d;
      |     ^~~
      |     |
      |     const char*
a.cc:20:4: error: ambiguous overload for 'operator[]' (operand types are 'std::map<char, int>' and 'const char [2]')
   20 |   M["e"] = e;
      |    ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:7: note:   conversion of argument 1 would be ill-formed:
a.cc:20:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   20 |   M["e"] = e;
      |     ^~~
      |     |
      |     const char*
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]' (near match)
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:7: note:   conversion of argument 1 would be ill-formed:
a.cc:20:5: error: invalid conversion from 'const char*' to 'std::map<char, int>::key_type' {aka 'char'} [-fpermissive]
   20 |   M["e"] = e;
      |     ^~~
      |     |
      |     const char*