Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  map<string int> a;
  for(int i=0; i=n; i++){
    string s;
    cin >> s;
    a[s]++;
  }
  for(auto p : a){
    int mx = max(mx, p.second);
  }
  for(auto p : a){
    if(p.second != mx){
      continue;
    }
    cout << p.first << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: two or more data types in declaration of 'type name'
    7 |   map<string int> a;
      |       ^~~~~~
a.cc:7:17: error: wrong number of template arguments (1, should be at least 2)
    7 |   map<string int> a;
      |                 ^
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:11:6: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   11 |     a[s]++;
      |      ^
a.cc:13:16: error: 'begin' was not declared in this scope
   13 |   for(auto p : a){
      |                ^
a.cc:13:16: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:13:16: error: 'end' was not declared in this scope
   13 |   for(auto p : a){
      |                ^
a.cc:13:16: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:16:16: error: 'begin' was not declared in this scope
   16 |   for(auto p : a){
      |                ^
a.cc:16:16: note: suggested alternatives:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:16:16: error: 'end' was not declared in this scope
   16 |   for(auto p : a){
      |                ^
a.cc:16:16: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:17:20: error: 'mx' was not declared in this scope
   17 |     if(p.second != mx){
      |                    ^~