Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define sz(a) int(a.size())
#define re return
using namespace std;
int s[100005];
int main()
{
	map<string>mp;
	int n;
	cin>>n;
	for (int i=0;i<n;i++)
	{
		cin>>s[i];
		mp[s[i]]++;
	}
	int best;
	for (int i=0;i<n;i++)  best=max(best,mp[s[i]]);
	vector<string>ans;
	for (int i=0;i<n;i++)  if (mp[s[i]]==best)  ans.pb(s[i]);
	sort(ans.begin(),ans.end());
	for (int i=0;i<sz(ans);i++)  cout<<ans[i];
	re 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: wrong number of template arguments (1, should be at least 2)
    9 |         map<string>mp;
      |                   ^
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:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:15:19: error: invalid types 'int[int]' for array subscript
   15 |                 mp[s[i]]++;
      |                   ^
a.cc:18:48: error: invalid types 'int[int]' for array subscript
   18 |         for (int i=0;i<n;i++)  best=max(best,mp[s[i]]);
      |                                                ^
a.cc:20:38: error: invalid types 'int[int]' for array subscript
   20 |         for (int i=0;i<n;i++)  if (mp[s[i]]==best)  ans.pb(s[i]);
      |                                      ^
a.cc:20:59: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(int&)'
   20 |         for (int i=0;i<n;i++)  if (mp[s[i]]==best)  ans.pb(s[i]);
      |                                                     ~~~~~~^~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~