Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char a[100][20];
    string b[20];
	int n,m,i,j,maxx=0;
	map<int,string> mm;
    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++)
    {
		scanf("%s",a[i]);
                b=a[i];
		mm[b]++;
	}
	for(i=0;i<n;i++)
	{
		scanf("%s",b);
		mm[b]--;
	}
	for(i=0;i<n;i++)
	{
                b=a[i];
		maxx=max(maxx,mm.count(b));
	}
	printf("%d",maxx);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: incompatible types in assignment of 'char [20]' to 'std::string [20]' {aka 'std::__cxx11::basic_string<char> [20]'}
   13 |                 b=a[i];
      |                 ~^~~~~
a.cc:14:19: error: ambiguous overload for 'operator[]' (operand types are 'std::map<int, std::__cxx11::basic_string<char> >' and 'std::string [20]' {aka 'std::__cxx11::basic_string<char> [20]'})
   14 |                 mm[b]++;
      |                   ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/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 = int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = int]' (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:14:20: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::map<int, std::__cxx11::basic_string<char> >::key_type' {aka 'int'} [-fpermissive]
   14 |                 mm[b]++;
      |                    ^
      |                    |
      |                    std::string* {aka std::__cxx11::basic_string<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 = int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = int]' (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:14:20: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::map<int, std::__cxx11::basic_string<char> >::key_type' {aka 'int'} [-fpermissive]
   14 |                 mm[b]++;
      |                    ^
      |                    |
      |                    std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:19:19: error: ambiguous overload for 'operator[]' (operand types are 'std::map<int, std::__cxx11::basic_string<char> >' and 'std::string [20]' {aka 'std::__cxx11::basic_string<char> [20]'})
   19 |                 mm[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 = int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = int]' (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:20: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::map<int, std::__cxx11::basic_string<char> >::key_type' {aka 'int'} [-fpermissive]
   19 |                 mm[b]--;
      |                    ^
      |                    |
      |                    std::string* {aka std::__cxx11::basic_string<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 = int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = int]' (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:20: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::map<int, std::__cxx11::basic_string<char> >::key_type' {aka 'int'} [-fpermissive]
   19 |                 mm[b]--;
      |                    ^
      |                    |
      |                    std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:23:18: error: incompatible types in assignment of 'char [20]' to 'std::string [20]' {aka 'std::__cxx11::basic_string<char> [20]'}
   23 |                 b=a[i];
      |                 ~^~~~~
a.cc:24:39: error: no matching function for call to 'std::map<int, std::__cxx11::basic_string<char> >::count(std::string [20])'
   24 |                 maxx=max(maxx,mm.count(b));
      |                               ~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:1264:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::count(const key_type&) const [with _Key = int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >; size_type = long unsigned int; key_type = int]' (near match)
 1264 |       count(const key_type& __x) const
      |       ^~~~~
/usr/include/c++/14/bits/stl_map.h:1264:7: note:   conversion of argument 1 would be ill-formed:
a.cc:24:40: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::map<int, std::__cxx11::basic_string<char> >::key_type' {aka 'int'} [-fpermissive]
   24 |                 maxx=max(maxx,mm.count(b));
      |                                        ^
      |                                        |
      |                                        std::string* {aka std::__cxx11::basic_string<char>*}
/usr/include/c++/14/bits/stl_map.h:1270:9: note: candidate: 'template<class _Kt> decltype (((const std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_count_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::count(const _Kt&) const [with _Key = int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >]'
 1270 |         count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
      |         ^~~~~
/usr/include/c++/14/bits/stl_map.h:1270:9: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((const std::map<int, std::__cxx11::basic_string<char> >*)this)->std::map<int, std::__cxx11::basic_string<char> >::_M_t.std::_Rb_tree<int, std::pair<const int, std::__cxx11::basic_string<char> >, std::_Select1st<std::pair<const int, std::__cxx11::basic_string<char> > >, std::less<int>, std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > > >::_M_count_tr<_Kt, _Req>(__x)) std::map<int, std::__cxx11::basic_string<char> >::count(const _Kt&) const [with _Kt = std::__cxx11::basic_string<char> [20]]':
a.cc:24:25:   required from here
   24 |                 maxx=max(maxx,mm.count(b));
      |                               ~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:1270:65: error: no matching function for call to 'std::_Rb_tree<int, std::pair<const int, std::__cxx11::basic_string<char> >, std::_Select1st<std::pair<const int, std::__cxx11::basic_string<char> > >, std::less<int>, std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > > >::_M_count_tr(const std::__cxx11::basic_string<char> [20]) const'
 1270 |         count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
      |                                                 ~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/map:62:
/usr/include/c++/14/bits/stl_tree.h:1311:9: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_count_tr(const _Kt&) const [with _Req = _Kt; _Key = int; _Val = std::pair<const int, std::__cxx11::basic_string<char> >; _KeyOfValue = std::_Select1st<std::pair<const int, std::__cxx11::basic_string<char> > >; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >]'
 1311 |         _M_count_tr(const _Kt& __k) const
      |         ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_tree.h:1311:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stl_function.h: In substitution of 'template<class _Func, class _SfinaeType> using std::__has_is_transparent_t = typename std::__has_is_transparent<_Func, _SfinaeType>::type [with _Func = std::less<int>; _SfinaeType = std::__cxx11::basic_string<char> [20]]':
/usr/include/c++/14/bits/stl_tree.h:1309:9:   required by substitution of 'template<class _Kt> decltype (((const std::map<int, std::__cxx11::basic_string<char> >*)this)->std::map<int, std::__cxx11::basic_string<char> >::_M_t.std::_Rb_tree<int, std::pair<const int, std::__cxx11::basic_string<char> >, std::_Select1st<std::pair<const int, std::__cxx11::basic_string<char> > >, std::less<int>, std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > > >::_M_count_tr<_Kt, _Req>(__x)) std::map<int, std::__cxx11::basic_string<char> >::count(const _Kt&) const [with _Kt = std::__cxx11::basic_string<char> [20]]'
 1309 |                typename _Req = __has_is_transparent_t<_Compare, _Kt>>
      |                ^~~~~~~~
a.cc:24:25:   required from here
   24 |                 maxx=max(maxx,mm.count(b));
      |                               ~~~~~~~~^~~
/usr/include/c++/14/bits/stl_function.h:1427:11: error: no type named 'type'