Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <unordered_map>
#include <map>
#include <complex>
#include <algorithm>

using namespace std;
using i64 = int_fast64_t;
using u64 = uint_fast64_t;
using i32 = int_fast32_t;
using u32 = uint_fast32_t;

#define int i64

template<class T>
inline bool chmin(T &a, T b) { if(a > b) {a = b; return true;} return false; }
template <class T>
inline bool chmax(T &a, T b) { if(a < b) {a = b; return true;} return false; }
const int INF = 1LL << 60;

signed main() {
	int n;
	cin >> n;

	string s;
	unordered_map<string, int> cnt;
	for(int i = 0; i < n; i++) {
		cin >> s;
		cnt[s]++;
	}

	int maxval = -1;
	std::vector<string> res;
	for(auto [key, value]: cnt) {
		if(value > maxval) {
			maxval = value;
			res.clear();
			res.emplace_back(key);
		} else if(value == maxval) res.emplace_back(key);
	}

	sort(res.begin(), res.end());

	for(int i = 0; i < res.size(); i++) cout << res[i] << endl;
	
	return 0;
}


Compiler output:
a.cc:11:13: error: 'int_fast64_t' does not name a type
   11 | using i64 = int_fast64_t;
      |             ^~~~~~~~~~~~
a.cc:12:13: error: 'uint_fast64_t' does not name a type
   12 | using u64 = uint_fast64_t;
      |             ^~~~~~~~~~~~~
a.cc:13:13: error: 'int_fast32_t' does not name a type
   13 | using i32 = int_fast32_t;
      |             ^~~~~~~~~~~~
a.cc:14:13: error: 'uint_fast32_t' does not name a type
   14 | using u32 = uint_fast32_t;
      |             ^~~~~~~~~~~~~
a.cc:16:13: error: 'i64' does not name a type
   16 | #define int i64
      |             ^~~
a.cc:22:7: note: in expansion of macro 'int'
   22 | const int INF = 1LL << 60;
      |       ^~~
a.cc: In function 'int main()':
a.cc:16:13: error: 'i64' was not declared in this scope
   16 | #define int i64
      |             ^~~
a.cc:25:9: note: in expansion of macro 'int'
   25 |         int n;
      |         ^~~
a.cc:26:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   26 |         cin >> n;
      |                ^
      |                yn
a.cc:29:34: error: template argument 5 is invalid
   29 |         unordered_map<string, int> cnt;
      |                                  ^
a.cc:30:17: error: expected ';' before 'i'
   30 |         for(int i = 0; i < n; i++) {
      |                 ^
a.cc:30:24: error: 'i' was not declared in this scope
   30 |         for(int i = 0; i < n; i++) {
      |                        ^
a.cc:32:20: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   32 |                 cnt[s]++;
      |                    ^
a.cc:35:13: error: expected ';' before 'maxval'
   35 |         int maxval = -1;
      |             ^~~~~~
a.cc:37:32: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   37 |         for(auto [key, value]: cnt) {
      |                                ^~~
      |                                std::begin
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:37:32: error: 'end' was not declared in this scope; did you mean 'std::end'?
   37 |         for(auto [key, value]: cnt) {
      |                                ^~~
      |                                std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc:38:28: error: 'maxval' was not declared in this scope
   38 |                 if(value > maxval) {
      |                            ^~~~~~
a.cc:47:17: error: expected ';' before 'i'
   47 |         for(int i = 0; i < res.size(); i++) cout << res[i] << endl;
      |                 ^
a.cc:47:24: error: 'i' was not declared in this scope
   47 |         for(int i = 0; i < res.size(); i++) cout << res[i] << endl;
      |                        ^