Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
const ll MOD = 1000000007;
const int MAX = 100000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }


int main(){
    int N; cin>>N;
    map<string,int> m;
	string S(N);
    int max=-1;
    for(int i=0;i<N;i++){
        string tmp;
        cin >> tmp;
      	S[i] = tmp;
        int c=m[tmp];
        //cerr << tmp << " " << m[tmp]  << endl;
        m[tmp] = c+1;
        if(max<c+1) max = c+1;

    }
  	sort(S.begin(),S.end());
    //cerr << max << "\n";
    for(auto i=m.begin();i!=m.end();i++){
        //cerr << i->first << "\t" << i->second << endl;
        if(i->second == max) cout << i->first << "\n";
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:19: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
   63 |         string S(N);
      |                   ^
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  800 |         basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
      |         ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8:   required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  149 |         using _If_sv = enable_if_t<
      |               ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30:   required from here
  797 |       template<typename _Tp, typename = _If_sv<_Tp, void>>
      |                              ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
 2711 |     using enable_if_t = typename enable_if<_Cond, _Tp>::type;
      |           ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  788 |         basic_string(const _Tp& __t, size_type __pos, size_type __n,
      |         ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  765 |         basic_string(_InputIterator __beg, _InputIterator __end,
      |         ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  669 |       basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  646 |       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note:   template argument deduction/substitution failed:
a.cc:63:18: note:   cannot convert 'N' (type 'int') to type 'const char*'
   63 |         string S(N);
      |                  ^
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  721 |       basic_string(basic_string&& __str, const _Alloc& __a)
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  716 |       basic_string(const basic_string& __str, const _Alloc& __a)
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  711 |       basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
  711 |       basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  682 |       basic_string(basic_string&& __str) noexcept
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note:   no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
  682 |       basic_string(basic_string&& __str) noexcept
      |                    ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
  624 |       basic_string(const _CharT* __s, size_type __n,
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
  604 |       basic_string(const basic_string& __str, size_type __pos,
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
  586 |       basic_string(const basic_string& __str, size_type __pos,
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
  569 |       basic_string(const basic_string& __str, size_type __pos,
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  552 |       basic_string(const basic_string& __str)
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note:   no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
  552 |       basic_string(const basic_string& __str)
      |                    ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  540 |       basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:540:34: note:   no known conversion for argument 1 from 'int' to 'const std::allocator<char>&'
  540 |       basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
      |                    ~~~~~~~~~~~~~~^~~
/usr/include/c+