Language: C++

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

int main(){
  int n;
  cin>>n;
  map<string,int> m;

  rep(i,n){
    string s;
    cin >> s;
    m[s]+=1;
  }
  rep(i,m.size()){
  if(m.at(i) == m.at(0)) cout >> m.at(i);  
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: no matching function for call to 'std::map<std::__cxx11::basic_string<char>, int>::at(int&)'
   16 |   if(m.at(i) == m.at(0)) cout >> m.at(i);
      |      ~~~~^~~
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:549:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::at(const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  549 |       at(const key_type& __k)
      |       ^~
/usr/include/c++/14/bits/stl_map.h:549:26: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  549 |       at(const key_type& __k)
      |          ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:558:7: note: candidate: 'const std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::at(const key_type&) const [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  558 |       at(const key_type& __k) const
      |       ^~
/usr/include/c++/14/bits/stl_map.h:558:26: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  558 |       at(const key_type& __k) const
      |          ~~~~~~~~~~~~~~~~^~~
a.cc:16:38: error: no matching function for call to 'std::map<std::__cxx11::basic_string<char>, int>::at(int&)'
   16 |   if(m.at(i) == m.at(0)) cout >> m.at(i);
      |                                  ~~~~^~~
/usr/include/c++/14/bits/stl_map.h:549:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::at(const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  549 |       at(const key_type& __k)
      |       ^~
/usr/include/c++/14/bits/stl_map.h:549:26: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  549 |       at(const key_type& __k)
      |          ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:558:7: note: candidate: 'const std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::at(const key_type&) const [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  558 |       at(const key_type& __k) const
      |       ^~
/usr/include/c++/14/bits/stl_map.h:558:26: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  558 |       at(const key_type& __k) const
      |          ~~~~~~~~~~~~~~~~^~~