Language: C++

#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>
#include <iostream>
#include<algorithm>
#include <stdio.h>

using namespace std;

int main() {
	int n,ma=0;
	string tmp;
	vector <string> v;
	vector <string> ans;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> tmp;
		v.push_back(tmp);
	}
	for (auto& i : v) {
		ma = max(count(v.begin(), v.end(), i),ma);
	}
	for (auto& i : v) {
		if (ma == count(v.begin(), v.end(), i)) {
			if (count(ans.begin(), ans.end(), i) == 0) {
				ans.push_back(i);
			}
		}
	}
	sort(ans.begin(), ans.end());

	for (auto& a : ans) {
		cout << a;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:25: error: no matching function for call to 'max(std::__iterator_traits<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >, void>::difference_type, int&)'
   28 |                 ma = max(count(v.begin(), v.end(), i),ma);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/hashtable_policy.h:36,
                 from /usr/include/c++/14/bits/hashtable.h:35,
                 from /usr/include/c++/14/bits/unordered_set.h:33,
                 from /usr/include/c++/14/unordered_set:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:28:25: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   28 |                 ma = max(count(v.begin(), v.end(), i),ma);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:12:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:28:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   28 |                 ma = max(count(v.begin(), v.end(), i),ma);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~