Language: C++

#include <iostream>
#include <map>
#include <string>
using namespace std;

int main(){
	map<int,int> name;
  	map<const char,int> name_to_int;
  	
  	name_to_int["M"]=0;
  	name_to_int["A"]=1;
  	name_to_int["R"]=2;
    name_to_int["C"]=3;
  	name_to_int["H"]=4;

  	int n;
  	cin>>n;
  	for(int i=0;i<n;i++){
      string s;
      cin>>s;
      name[name_to_int[s[0]]]+=1;
    }
  	int ans=0;
  	for(int i=0;i<n;i++){
      for(int j=i+1;j<n;j++){
        for(int k=j+1;k<n;k++){
          ans+=name[i]*name[j]*name[k];
        }
      }
    }
  	cout<<ans<<endl;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: invalid conversion from 'const char*' to 'std::map<const char, int>::key_type' {aka 'char'} [-fpermissive]
   10 |         name_to_int["M"]=0;
      |                     ^~~
      |                     |
      |                     const char*
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:524:29: note:   initializing argument 1 of 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = const char; _Tp = int; _Compare = std::less<const char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = const char]'
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:11:21: error: invalid conversion from 'const char*' to 'std::map<const char, int>::key_type' {aka 'char'} [-fpermissive]
   11 |         name_to_int["A"]=1;
      |                     ^~~
      |                     |
      |                     const char*
/usr/include/c++/14/bits/stl_map.h:524:29: note:   initializing argument 1 of 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = const char; _Tp = int; _Compare = std::less<const char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = const char]'
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:12:21: error: invalid conversion from 'const char*' to 'std::map<const char, int>::key_type' {aka 'char'} [-fpermissive]
   12 |         name_to_int["R"]=2;
      |                     ^~~
      |                     |
      |                     const char*
/usr/include/c++/14/bits/stl_map.h:524:29: note:   initializing argument 1 of 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = const char; _Tp = int; _Compare = std::less<const char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = const char]'
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:13:17: error: invalid conversion from 'const char*' to 'std::map<const char, int>::key_type' {aka 'char'} [-fpermissive]
   13 |     name_to_int["C"]=3;
      |                 ^~~
      |                 |
      |                 const char*
/usr/include/c++/14/bits/stl_map.h:524:29: note:   initializing argument 1 of 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = const char; _Tp = int; _Compare = std::less<const char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = const char]'
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:14:21: error: invalid conversion from 'const char*' to 'std::map<const char, int>::key_type' {aka 'char'} [-fpermissive]
   14 |         name_to_int["H"]=4;
      |                     ^~~
      |                     |
      |                     const char*
/usr/include/c++/14/bits/stl_map.h:524:29: note:   initializing argument 1 of 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = const char; _Tp = int; _Compare = std::less<const char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = const char]'
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~