Language: C++

#include <bits/stdc++.h>
#define itn int
#define rep(i, n) for (int i = 0; i < n; i++)
#define MOD 1000000007
using namespace std;
typedef long long ll;

const ll INF = 1LL << 60;

int main(){
    int n;
    cin >> n;
    vector<string> s(n);
    string s="MARCH";
    set<char> st;
    int ans[5]={};
    rep(i,n){
        cin >> s[i];
        int tmp=s.find(s[i][0]);
        if(tmp!=-1){
            st.insert(s[tmp]);
            ans[tmp]++;
        }
    }
    int a=0;
    rep(i,3){
        int tmp=ans[i];
        for(int j=i+1;i!=4;i++){
            tmp*=ans[j];
            for(int k=j+1;k!=5;k++){
                tmp*=ans[k];
            }
        }
        a+=tmp;
    }
    cout << a << 3ndl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: conflicting declaration 'std::string s'
   14 |     string s="MARCH";
      |            ^
a.cc:13:20: note: previous declaration as 'std::vector<std::__cxx11::basic_string<char> > s'
   13 |     vector<string> s(n);
      |                    ^
a.cc:19:19: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'find'
   19 |         int tmp=s.find(s[i][0]);
      |                   ^~~~
a.cc:21:22: error: no matching function for call to 'std::set<char>::insert(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)'
   21 |             st.insert(s[tmp]);
      |             ~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/set:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_set.h:568:9: note: candidate: 'template<class _InputIterator> void std::set<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>]'
  568 |         insert(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_set.h:568:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_set.h:511:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<char>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<char>, char>::rebind<char>; typename _Alloc::value_type = char; value_type = char]'
  511 |       insert(const value_type& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_set.h:511:32: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::set<char>::value_type&' {aka 'const char&'}
  511 |       insert(const value_type& __x)
      |              ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_set.h:520:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<char>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<char>, char>::rebind<char>; typename _Alloc::value_type = char; value_type = char]'
  520 |       insert(value_type&& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_set.h:520:27: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::set<char>::value_type&&' {aka 'char&&'}
  520 |       insert(value_type&& __x)
      |              ~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_set.h:548:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(const_iterator, const value_type&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>; iterator = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator; const_iterator = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator; value_type = char]'
  548 |       insert(const_iterator __position, const value_type& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_set.h:548:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_set.h:553:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(const_iterator, value_type&&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>; iterator = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator; const_iterator = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator; value_type = char]'
  553 |       insert(const_iterator __position, value_type&& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_set.h:553:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_set.h:580:7: note: candidate: 'void std::set<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>]'
  580 |       insert(initializer_list<value_type> __l)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_set.h:580:43: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::initializer_list<char>'
  580 |       insert(initializer_list<value_type> __l)
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_set.h:600:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::insert_return_type std::set<_Key, _Compare, _Alloc>::insert(node_type&&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>; insert_return_type = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::insert_return_type; node_type = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::node_type]'
  600 |       insert(node_type&& __nh)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_set.h:600:26: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::set<char>::node_type&&' {aka 'std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::node_type&&'}
  600 |       insert(node_type&& __nh)
      |              ~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_set.h:605:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(const_iterator, node_type&&) [with _Key = char; _Compare = std::less<char>; _Alloc = std::allocator<char>; iterator = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator; const_iterator = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator; node_type = std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::node_type]'
  605 |       insert(const_iterator __hint, node_type&& __nh)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_set.h:605:7: note:   candidate expects 2 arguments, 1 provided
a.cc:36:18: error: unable to find numeric literal operator 'operator""ndl'
   36 |     cout << a << 3ndl;
      |                  ^~~~