criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<string>
#include<math.h>
#include<cstring>
using namespace std;
string s[200005];
bool cmp(string a,string b)
{
    return a.compare(b)<0;
}
int main()
{
    int n;
    int i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        cin>>s[i];
    sort(s,s+n,cmp);
    int con=1;
    int y=1;
    for(i=1;i<n;i++)
    {
        if(s[i].compare(s[i-1])==0)
            con++;
        else
            con=1;
        y=max(con,y);
    }
    con=1;
    if(y==1)cout<<s[0]<<endl;
    for(i=1;i<n;i++)
    {
        if(s[i].compare(s[i-1])==0)
            con++;
        else
            con=1;
        if(con==m)
        cout<<s[i]<<endl;
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'm' was not declared in this scope
   39 |         if(con==m)
      |                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

bool sortc (pair<string, int>& a, pair<string, int>& b)
{
		return ((a.second > b.second ) || (a.second == b.second && a.first < b.first));
}

int main()
{
	
	int n;
	cin >> n;
	
	while (n--)
	{
		vector<pair<string, int>> mout;
		bool flag = true;
		
		string s;
		cin >> s;
		
		for (auto& e : mout)
		{
			if (!(s.compare(e.first)))
			{
				e.second++;
				flag = false;
			}
		}
		if (flag)	
			mout.push_back({s, 1});
		
	}
	sort(mout.begin(), mout.end(), sortc);
	int k = mout[0].second, i = 0;
	while(mout[i].second == k)
		cout << mout[i++].first<<"\n";

	return 0;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:14: error: 'mout' was not declared in this scope
   36 |         sort(mout.begin(), mout.end(), sortc);
      |              ^~~~
a.cc:38:20: error: 'i' was not declared in this scope
   38 |         while(mout[i].second == k)
      |                    ^
Language: C++

#include<iostream>
#include<string>
#include<unordered_map>

using namespace std;

int main()
{
	int N;
  	cin >> N;
  	unordered_map<string, int>count;
  	int m = 1;
  	while(N--)
    {
    	string s;
      	cin >> s;
      	auto it = count.find(s);
      	if(it == count.end())
        	count[s] = 1;
      	else
        {
        	it->second += 1;
          	m = max(m, it->second);
        }
    }
  	vector<string>result;
  	for(auto it = count.begin(); it != count.end(); it++)
    {
    	if(it->second == m) 
          result.push_back(it->first);
    }
  	sort(result.begin(), result.end());
  	for(auto r: result)
      	cout << r << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'vector' was not declared in this scope
   26 |         vector<string>result;
      |         ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include<unordered_map>
  +++ |+#include <vector>
    4 | 
a.cc:26:22: error: expected primary-expression before '>' token
   26 |         vector<string>result;
      |                      ^
a.cc:26:23: error: 'result' was not declared in this scope
   26 |         vector<string>result;
      |                       ^~~~~~
a.cc:32:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   32 |         sort(result.begin(), result.end());
      |         ^~~~
      |         short
Language: C++

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

int main(){
 int n;
 cin >> n;
  //9行目の解説　keyがstringでvalueがint
 map<string,int> mp;
 rep(i,n){
   string s;
   cin >> s;
   mp[s]++;
 }
 //17行目の解説　頻度の最大値を求めている
 int mx = 0;
 for (auto p : mp) mx = max(mx, p.second);
 for (auto p : mp) {
   if(p.second != mx) continue;
   cout << p.first << endl;
 }
  return 0;
}


Compiler output:
a.cc:4:7: error: expected nested-name-specifier before numeric constant
    4 | using 11 = Long Long;
      |       ^~
Language: C++

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

int main(){
 int n;
 cin >> n;
  //9行目の解説　keyがstringでvalueがint
 map<string,int> mp;
 rep(i,n){
   string s;
   cin >> s;
   mp[s]++;
 }
 //17行目の解説　頻度の最大値を求めている
 int mx = 0;
 for (auto p : mp) mx = max(mx, p.second);
 for (auto p : mp) {
   if(p.second != mx) continue;
   cout << p.first << endl;
 }
  return 0;
}


Compiler output:
a.cc:4:7: error: expected nested-name-specifier before numeric constant
    4 | using 11 = Long Long;
      |       ^~
Language: C++

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

int main(){
 int n;
 cin >> n;
  //9行目の解説　keyがstringでvalueがint
 map<string,int> mp;
 rep(i,n){
   string s;
   cin >> s;
   mp[s]++;
 }
 //17行目の解説　頻度の最大値を求めている
 int mx = 0;
 for (auto p : mp) mx = max(mx, p.second);
 for (auto p : mp) {
   if(p.second != mx) continue;
   cout << p.first << endl;
 }
}


Compiler output:
a.cc:4:7: error: expected nested-name-specifier before numeric constant
    4 | using 11 = Long Long;
      |       ^~
Language: C++

#include <iostream>
#include <map>
#include <string>
using namespace std;

int main(){
    int N;
    string S;
    map<string,int> m;

    cin>>N;
    for(int i=0;i<N;i++){
        cin>>S;
        m[S]++;
    }
    
    int max=0;
    for(const auto& x:m){
        if(x.second>max){
            max=x.second;
        }
    }

    for(const auto& x:m){
        if(x.second==max){
            cout<<x.first<<'\n';
        }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:28:6: error: expected '}' at end of input
   28 |     }
      |      ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C

#include <stdio.h>
#include <map>
#include <iostream>
#include <string>

using namespace std;




int main(void){

  int N;
  cin>>N;
  string S[N];
  int i,max=0;
  for(i=0;i<N;i++)
    cin>>S[i];

   map <string,int> m;
  for(i=0;i<N;i++){
    m[S[i]]++;
     if(max<m[S[i]])
       max=m[S[i]];
  }
    
   for(i=0;i<N;i++){
    if(max<m[S[i]])
      max=m[S[i]];
      }
   for(auto i=m.begin();i!=m.end();i++){
    if(i -> second==max){
      cout<< i-> first<<endl;
      
    }   
  }
 



  
  return 0;
}


Compiler output:
main.c:2:10: fatal error: map: No such file or directory
    2 | #include <map>
      |          ^~~~~
compilation terminated.
Language: C++

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

int main(){
 int n;
 cin >> n;
  //9行目の解説　keyがstringでvalueがint
 map<string,int> mp;
 rep(i,n){
   string s;
   cin >> s;
   mp[s]++;
 }
 //17行目の解説　頻度の最大値を求めている
 int mx = 0;
 for (auto p : mp) mx = max(mx, p.second);
 for (auto p : mp) {
   if(p.second != mx) contine;
   cout << p.first << endl;
 }
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: 'contine' was not declared in this scope
   19 |    if(p.second != mx) contine;
      |                       ^~~~~~~
a.cc: At global scope:
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
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;
  
  rep(i,n){
    string s;
    cin >> s;
    map[s]+=1;
  }
  rep(i,map.size()){
  if(map.at(i) == map.at(0)) cout >> map.at(i);  
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: conflicting declaration 'auto s'
   12 |     map[s]+=1;
      |         ^
a.cc:10:12: note: previous declaration as 'std::string s'
   10 |     string s;
      |            ^
a.cc:12:11: error: expected initializer before '+=' token
   12 |     map[s]+=1;
      |           ^~
a.cc:14:12: error: missing template arguments before '.' token
   14 |   rep(i,map.size()){
      |            ^
a.cc:3:32: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
a.cc:15:9: error: expected unqualified-id before '.' token
   15 |   if(map.at(i) == map.at(0)) cout >> map.at(i);
      |         ^
a.cc:15:41: error: missing template arguments before '.' token
   15 |   if(map.at(i) == map.at(0)) cout >> map.at(i);
      |                                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<char> vchar;
typedef vector<vector<char>> vvchar;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef priority_queue<long long> prque;
#define ain(i,n,a) for(long long i=0;i<(long long)(n);i++){cin>>a[i];}
#define aout(i,n,a) for(long long i=0;i<(long long)(n);i++){if(i){cout<<" ";}cout<<a[i];if(i==n-1){cout<<endl;}}
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define vsort(v) sort((v).begin(),(v).end())
#define vrsort(v) sort((v).rbegin(),(v).rend())
#define vreverse(v) reverse((v).begin(),(v).end())
#define pf(a) push_front(a)
#define pb(a) push_back(a)
#define INF 1998021900
#define MOD 1000000007
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  //input
  ll n;cin>>n;map<string,ll> m;ll p=0;
  rep(i,n){
    cin>>s[i];
    m[s[i]]++;
    if(m[s[i]]>p){p=m[s[i]];}
          }
  //caricurate
  rep(i,n){
  if(m[s[i]]==p){cout<<s[i]<<endl;m[s[i]]=0;}
  }
  
  //output
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: 's' was not declared in this scope
   27 |     cin>>s[i];
      |          ^
a.cc:33:8: error: 's' was not declared in this scope
   33 |   if(m[s[i]]==p){cout<<s[i]<<endl;m[s[i]]=0;}
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int n; cin >> n;
  	map<string, int> m;
  	int mx = 0;
  	for (int i = 0; i < n; i++) {
    	string s; cin >> s;
      	m[s]++;
      	mx = max(mx, m[s]);
    }
  	vector<string> ans;
  	for (auto s : m) if (m[s.second] == mx) ans.push_back(s.first);
  	sort(ans.begin(), ans.end());
  	for (string s : ans) {
     	cout << s << endl; 
    }
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and 'int')
   13 |         for (auto s : m) if (m[s.second] == mx) ans.push_back(s.first);
      |                               ^
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:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](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>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: 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>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](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>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'int' to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int n; cin >> n;
  	map<string, int> m;
  	int mx = 0;
  	for (int i = 0; i < n; i++) {
    	string s; cin >> s;
      	m[s]++;
      	mx = max(mx, m[s]);
    }
  	vector<string> ans;
  	for (auto s : m) if (m[s.first] == mx) ans.push_back(s.second);
  	sort(ans.begin(), ans.end());
  	for (string s : ans) {
     	cout << s << endl; 
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:61: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(int&)'
   13 |         for (auto s : m) if (m[s.first] == mx) ans.push_back(s.second);
      |                                                ~~~~~~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int n; cin >> n;
  	map<string, int> m;
  	int mx = 0;
  	for (int i = 0; i < n; i++) {
    	string s; cin >> s;
      	m[s]++;
      	mx = max(mx, m[s]);
    }
  	vector<string> ans;
  	for (string s : m) if (m[s] == mx) ans.push_back(s);
  	sort(ans.begin(), ans.end());
  	for (string s : ans) {
     	cout << s << endl; 
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: conversion from 'std::pair<const std::__cxx11::basic_string<char>, int>' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   13 |         for (string s : m) if (m[s] == mx) ans.push_back(s);
      |                         ^
Language: Java

import java.util.Map.Entry;
// import java.util.List;
// import java.util.ArrayList;
// import java.util.Scanner;
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        List<String> strs = new ArrayList<>();
        String gomi =sc.hasNext();
        while (sc.hasNext()) {
            strs.add(sc.nextLine());
            }
        Map<String, Integer> m = new HashMap<>();
        for (String s : strs) {
            int v;
            if (m.containsKey(s)) {
                v = m.get(s) + 1;
            } else {
                v = 1;
            }
            m.put(s, v);
        }
    Map.Entry<String, Integer> maxEntry = null;
    List<String> keys = new ArrayList<>();
    //String maxkey = null;
    int maxvalue = 0;
    for (Entry<String, Integer> entry : m.entrySet()) {
        if (maxEntry == null || (entry.getValue()) >= maxvalue) {
            maxEntry = entry;
            keys.add(maxEntry.getKey());
            maxvalue = maxEntry.getValue();
            }
        }
    for(String s:keys){
            System.out.println(s);
    }
    }
}

Compiler output:
Main.java:10: error: incompatible types: boolean cannot be converted to String
        String gomi =sc.hasNext();
                               ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
map<string,int> memo;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		string s;
		cin>>s;
		memo[s]++;
	}
	int maxv=0;
	for(const auto& x:memo){
		int v=x.second;
		if(v>maxv) maxv=v;
	}
	for(auto it=memo.begin;it!=memo.end;it++){
		if(it->second==maxv){
			cout<<it->first<<endl;
		}
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: unable to deduce 'auto' from 'memo.std::map<std::__cxx11::basic_string<char>, int>::begin'
   17 |         for(auto it=memo.begin;it!=memo.end;it++){
      |                     ~~~~~^~~~~
a.cc:17:26: note:   couldn't deduce template parameter 'auto'
   17 |         for(auto it=memo.begin;it!=memo.end;it++){
      |                          ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  
  int n;
  cin>>n;
  map<string,int> mp;
  for(int i=0;i<n;i++)
  {
  string str;
    cin>>str;
    mp[str]++;
  }
  vector<string>xxx;
  int maxx=0;
  for(auto it=mp.begin();it!=mp.end();it++)
  {
  maxx=max(maxx,it.second);
  }
  
  for(auto it=mp.begin();it!=mp.end();it++)
  {
  if(it->second==maxx)
    xxx.push_back(it.first);
  }
  sort(xxx.begin(),xxx.end());
  
  for(auto it: xxx)
    cout<<it<<endl;
  
 }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: 'struct std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >' has no member named 'second'
   19 |   maxx=max(maxx,it.second);
      |                    ^~~~~~
a.cc:25:22: error: 'struct std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >' has no member named 'first'
   25 |     xxx.push_back(it.first);
      |                      ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  
  int n;
  cin>>n;
  map<string,int> mp;
  for(int i=0;i<n;i++)
  {
  string str;
    cin>>str;
    mp[str]++;
  }
  vector<string>xxx;
  int cmax=0;
  for(auto it=mp.begin();it!=mp.end();it++)
  {
  maxx=max(maxx,it.second);
  }
  
  for(auto it=mp.begin()lit!=mp.end();it++)
  {
  if(it->second==maxx)
    xxx.push_back(it->first);
  }
  sort(xxx.begin(),xxx.end());
  
  for(auto it: xxx)
    cout<<it<<endl;
  
 }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'maxx' was not declared in this scope
   19 |   maxx=max(maxx,it.second);
      |   ^~~~
a.cc:19:20: error: 'struct std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >' has no member named 'second'
   19 |   maxx=max(maxx,it.second);
      |                    ^~~~~~
a.cc:22:25: error: expected ';' before 'lit'
   22 |   for(auto it=mp.begin()lit!=mp.end();it++)
      |                         ^~~
      |                         ;
a.cc:22:25: error: 'lit' was not declared in this scope; did you mean 'it'?
   22 |   for(auto it=mp.begin()lit!=mp.end();it++)
      |                         ^~~
      |                         it
a.cc:24:18: error: 'maxx' was not declared in this scope
   24 |   if(it->second==maxx)
      |                  ^~~~
Language: C++

#include <iostream>
using std::cin;
using std::cout;
using std::endl;

#include <map>
using std::map;

#include <string>
using std::string;

map<string, int> memo;

int main(void) {
	int n;
	scand("%lld", &n);
	for (int i=0; i<n; i++) {
		string s; cin >> s;
		memo[s] += 1;
	}

	int mx = 0;
	for (const auto& x: memo) {
		int v = x.second;
		if (v > mx) mx = v; 
	}

	for (auto it = memo.begin(); it != memo.end(); it++) {
		if (it->second == mx)
			cout << it->first << '\n';
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'scand' was not declared in this scope; did you mean 'srand'?
   16 |         scand("%lld", &n);
      |         ^~~~~
      |         srand
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:33: error: 'class std::map<std::__cxx11::basic_string<char>, int>' has no member named 'second'
   16 |   for(auto p:mp) mx = max(mx,mp.second);
      |                                 ^~~~~~
Language: C++

#include<iostream>
#include <algorithm>
using namespace std;
#define FOR(xxx,begin,num) for(int xxx=(begin);xxx<((begin)+(num));xxx++)
int main(){
  int N,cnt[200010];string S[200010],sw;
  cin >> N;
  FOR(i,0,N) cin >> S[i];
  sort(S, S + N);
  int tmp = 0,max = 0;
  cnt[0] = 0;
  FOR(i,1,N-1){
    if(S[tmp]==S[i]){cnt[tmp]++;}
    else{cnt = i;cnt[tmp]++;}
  }
  FOR(i,0,N){
    if(max < cnt[i]){
      max = cnt[i];
    }
  }
  FOR(i,0,N){
    if(cnt[i]==max) cout << S[i] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: incompatible types in assignment of 'int' to 'int [200010]'
   14 |     else{cnt = i;cnt[tmp]++;}
      |          ~~~~^~~
Language: C++

#include<iostream>
#include <algorithm>
using namespace std;
#define FOR(xxx,begin,num) for(int xxx=(begin);xxx<((begin)+(num));xxx++)
int main(){
  int N,cnt[200010];string S[200010],sw;
  cin >> N;
  FOR(i,0,N) cin >> S[i];
  sort(S, S + N, smaller<string>());
  int tmp = 0,max = 0;
  cnt[0] = 0;
  FOR(i,1,N-1){
    if(S[tmp]==S[i]){cnt[tmp]++;}
    else{cnt = i;cnt[tmp]++;}
  }
  FOR(i,0,N){
    if(max < cnt[i]){
      max = cnt[i];
    }
  }
  FOR(i,0,N){
    if(cnt[i]==max) cout << S[i] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'smaller' was not declared in this scope
    9 |   sort(S, S + N, smaller<string>());
      |                  ^~~~~~~
a.cc:9:32: error: expected primary-expression before '>' token
    9 |   sort(S, S + N, smaller<string>());
      |                                ^
a.cc:9:34: error: expected primary-expression before ')' token
    9 |   sort(S, S + N, smaller<string>());
      |                                  ^
a.cc:14:14: error: incompatible types in assignment of 'int' to 'int [200010]'
   14 |     else{cnt = i;cnt[tmp]++;}
      |          ~~~~^~~
Language: C++

#include<iostream>
#include <algorithm>
using namespace std;
#define FOR(xxx,begin,num) for(int xxx=(begin);xxx<((begin)+(num));xxx++)
int main(){
  int N;string S[200010],sw;
  cin >> N;
  FOR(i,0,N) cin >> S[i];
  sort(S, S + N, smaller<string>());
  cout << S[0] << endl;
  FOR(i,0,N-1){
    if(S[i]!=S[i+1]){cout << S[i+1] << endl;}
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'smaller' was not declared in this scope
    9 |   sort(S, S + N, smaller<string>());
      |                  ^~~~~~~
a.cc:9:32: error: expected primary-expression before '>' token
    9 |   sort(S, S + N, smaller<string>());
      |                                ^
a.cc:9:34: error: expected primary-expression before ')' token
    9 |   sort(S, S + N, smaller<string>());
      |                                  ^
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<long long> A(N+1);
    vector<long long> B(N);
    for(int i = 0; i < N+1; i++){
        cin >> A.at(i);
    }
    for(int i = 0; i < N; i++){
        cin >> B.at(i);
    }
    
    long long int count = 0;

    for(int i = 0; i < N; i++){
        if(A.at(i) - B.at(i) >= 0){ //一つも殺せない
            count += B.at(i);
        }
        else if(B.at(i) - A.at(i) + A.at(i+1) <= 0){ //二つとも殺せる
            count += A.at(i) + A.at(i+1);
            A.at(i+1) = 0;
        }
        else { //一つ目は殺せるが二つ目が殺せない
            count -= B.at(i));
            A.at(i+1) -= B.at(i) - A.at(i);
        }
    }

    cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:29: error: expected ';' before ')' token
   27 |             count -= B.at(i));
      |                             ^
      |                             ;
Language: C++

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

int main(){
  map<string int> a;
  vector<string> b;
  int n, k, p;
  k = 0;
  string s;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> s;
    p = 0;
    while(p < k + 1){
      if(p == k){
        k++;
        b.push_back(s);
        a[b[p]] = 0;
      }
      else if(b[p] == s){
        a[b[p]]++;
        p = k + 1;
      }
      else p++;
    }
  }
  p = 0;
  for(int i = 0; i < k; i++)
    p = max(p, b[a[i]]);
  for(int i = 0; i < k; i++){
    if(p == b[a[i]])
      cout << a[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: two or more data types in declaration of 'type name'
    5 |   map<string int> a;
      |       ^~~~~~
a.cc:5:17: error: wrong number of template arguments (1, should be at least 2)
    5 |   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:18:10: error: no match for 'operator[]' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'})
   18 |         a[b[p]] = 0;
      |          ^
a.cc:21:10: error: no match for 'operator[]' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'})
   21 |         a[b[p]]++;
      |          ^
a.cc:29:19: error: invalid types 'int[int]' for array subscript
   29 |     p = max(p, b[a[i]]);
      |                   ^
a.cc:31:16: error: invalid types 'int[int]' for array subscript
   31 |     if(p == b[a[i]])
      |                ^
a.cc:32:16: error: invalid types 'int[int]' for array subscript
   32 |       cout << a[i] << endl;
      |                ^
Language: C++

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

int main(){
	int N;
  	cin >> N;
  	vector<string> input;
  	for(int i=0;i<N;i++){
		cin >> input.at(i);
    }
  
  	map<string,int> data;
  	for(auto p : input){
      data[p]++;
    }
  	
  	string key;
  	int max=-1;
  	for(auto tmp : data){
		string key = tmp.first;
      	int key = tmp.second;
      	if(value > max){
          max = value;
        }
    }
    
  	for(auto tmp : data){
      string key = tmp.first;
      int value = tmp.second;
      if(value == max){
		cout << key << endl;
      }
    }
  
  	return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: conflicting declaration 'int key'
   21 |         int key = tmp.second;
      |             ^~~
a.cc:20:24: note: previous declaration as 'std::string key'
   20 |                 string key = tmp.first;
      |                        ^~~
a.cc:22:12: error: 'value' was not declared in this scope
   22 |         if(value > max){
      |            ^~~~~
Language: C++

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

int main(){
	int N;
  	cin >> N;
  	vector<string> input;
  	for(int i=0;i<N;i++){
		cin >> input.at(i);
    }
  
  	map<string,int> data;
  	for(auto p : input){
      data[p]++;
    }
  	
  	string key;
  	int max=-1;
  	for(auto tmp : data){
		string key = tmp.first;
      	int key = tmp.second;
      	if(value > max){
          max = value;
        }
    }
    
  	for(auto tmp : data){
      key = tmp.first;
      value = tmp.second;
      if(value == max){
		cout << key << endl;
      }
    }
  
  	return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: conflicting declaration 'int key'
   21 |         int key = tmp.second;
      |             ^~~
a.cc:20:24: note: previous declaration as 'std::string key'
   20 |                 string key = tmp.first;
      |                        ^~~
a.cc:22:12: error: 'value' was not declared in this scope
   22 |         if(value > max){
      |            ^~~~~
a.cc:29:7: error: 'value' was not declared in this scope
   29 |       value = tmp.second;
      |       ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf=0x3f3f3f3f;
int main()
{
	int n;cin>>n;
	string s;
	map<string,int>mp;
	int maxn=0;
	for(int i=0;i<n;i++)
	{
		cin>>s;
		mp[s]++;
		maxn=max(maxn,mp[s]);
	} 
	 for(auto p : mp)
	 {
        if(p.second == mx) 
		cout<<p.first<<endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: 'mx' was not declared in this scope; did you mean 'mp'?
   19 |         if(p.second == mx)
      |                        ^~
      |                        mp
Language: C++

#include <algorithm>
#include <bitset>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/range/irange.hpp>
#include <cmath>
#include <map>
#include <numeric>
#include <iostream>
#include <string>
#include <vector>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define decn int n = 0; cin >> n

using namespace std;
namespace mp = boost::multiprecision;
typedef long long ll;
const ll M = 1000000007;

int main(){
	decn;
	map<string, int> mp;

	int max = 0;
	rep(i, n) {
		string s;
		cin >> s;
		mp[s]++;
		if (max < mp[s]) {
			max = mp[s];
		}
	}

	vector<string> st;
	for (const auto& [key, value] : mp) {
		if (value == max) {
			st.push_back(key);
		}
	}

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

	rep(i, st.size()) {
		cout << st[i] << endl;
	}

	return 0;
}


Compiler output:
a.cc:3:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    3 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

int main() {
  int n; cin >> n;
  map<string, int> mp;
  int maxv = 0;
  for (int i = 0; i < n; i ++) {
    string s; cin >> s;
    mp[s] ++;
    maxv = max(maxv, mp[s].second);
  }

  for (int i = 0; i < n; i ++) {
    if (mp[s].second == maxv) cout << mp[s].first << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:28: error: request for member 'second' in 'mp.std::map<std::__cxx11::basic_string<char>, int>::operator[](s)', which is of non-class type 'std::map<std::__cxx11::basic_string<char>, int>::mapped_type' {aka 'int'}
   14 |     maxv = max(maxv, mp[s].second);
      |                            ^~~~~~
a.cc:18:12: error: 's' was not declared in this scope
   18 |     if (mp[s].second == maxv) cout << mp[s].first << endl;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  string s[n];
  for(int i=0;i<n;i++)
  {
    cin>>s[i];
  }
  map<string ,int>str;
  for(int i=0;i<n;i++)
  { 
    ++str[s[i]];
  }
  int arg_max = 0, current_max=0;
  for(auto it=str.begin();it!=str.end();it++)
  {
    if(it->second > current_max)
    {
    	arg_max = it->first;
      	current_max = it->second;
    }
  }
  cout<<arg_max;
 // auto max=get_max(str);
//std::cout << max.first; //<< "=>" << max.second << std::endl; 
 // }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: cannot convert 'const std::__cxx11::basic_string<char>' to 'int' in assignment
   22 |         arg_max = it->first;
      |                   ~~~~^~~~~
      |                       |
      |                       const std::__cxx11::basic_string<char>
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  string s[n];
  for(int i=0;i<n;i++)
  {
    cin>>s[i];
  }
  map<string ,int>str;
  for(int i=0;i<n;i++)
  { 
    ++str[s[i]];
  }
  for(auto it=str.begin();it!=str.end();it++)
  {
   // cout<<it->first<<endl;
 // }
  auto max=get_max(str);
std::cout << max.first; //<< "=>" << max.second << std::endl; 
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: 'get_max' was not declared in this scope
   21 |   auto max=get_max(str);
      |            ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  string s[n];
  for(int i=0;i<n;i++)
  {
    cin>>s[i];
  }
  map<string ,int>str;
  for(int i=0;i<n;i++)
  {
    str[s[i]]=0;
  }
  for(auto it=str.begin();it!=str.end();it++)
  {
    cout<<str[s[i]];
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'i' was not declared in this scope; did you mean 'it'?
   19 |     cout<<str[s[i]];
      |                 ^
      |                 it
Language: C++

#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const int maxn = 2e5 + 5 ;
map<string , int> num ;
int n ;
string s ;
int main()
{
	std::ios::sync_with_stdio(false) ;
    cin.tie(0)
    cin >> n ;
	for(int i = 1 ; i <= n ; i ++)  cin >> s , num[s] ++ ;
	int max1 = 0 ;
	for(auto x : num)  max1 = max(max1 , x.second) ;
	for(auto x : num)  if(x.second == max1)  cout << x.first << '\n' ;
	return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected ';' before 'cin'
   11 |     cin.tie(0)
      |               ^
      |               ;
   12 |     cin >> n ;
      |     ~~~
Language: C++

import * as fs from "fs";

const split = (str: string): string[] =>
  str.split(" ").map((v: string) => v.trim());
const split_number = (str: string): number[] =>
  split(str).map((v: string) => +v);

export function main(input: string) {
  const lines = input.split("\n");
  const [n] = split_number(lines[0]);
  let S = lines.slice(1);
  S.sort();

  let datums: { [keys: string]: number } = {};
  let max = 0;

  for (let i = 0; i < n; i++) {
    datums[S[i]] = (datums[S[i]] || 0) + 1;
    max = max < datums[S[i]] ? datums[S[i]] : max;
  }

  const result = Object.keys(datums)
    .sort()
    .filter(key => datums[key] === max);

  return result.join("\n");
}

if (!process.env.LOCAL_DEBUG) {
  console.log(main(fs.readFileSync("/dev/stdin", "utf8")));
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import * as fs from "fs";
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:7: error: 'split' does not name a type
    3 | const split = (str: string): string[] =>
      |       ^~~~~
a.cc:5:7: error: 'split_number' does not name a type
    5 | const split_number = (str: string): number[] =>
      |       ^~~~~~~~~~~~
a.cc:8:1: warning: keyword 'export' is deprecated, and is ignored
    8 | export function main(input: string) {
      | ^~~~~~
a.cc:8:8: error: 'function' does not name a type; did you mean 'union'?
    8 | export function main(input: string) {
      |        ^~~~~~~~
      |        union
a.cc:29:1: error: expected unqualified-id before 'if'
   29 | if (!process.env.LOCAL_DEBUG) {
      | ^~
Language: C++

#include<bits/stdc++.h>
#include<cmath>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
const ll MOD = 1000000007;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};
#define print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
#define fs first
#define sc second
 
template<typename T>
T gcd(T a,T b){return b?gcd(b,a%b):a;}

const int INF = 1e9;
const ll LLINF = 1e16;
 
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
 
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

// 割り算の切り上げ処理
template<typename T>
T round_up(T a, T b) {
  return (a + b - 1) / b;
}


using pint = pair<int, int>;
using pll = pair<ll, ll>;


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    ll n;
    cin >> n;
    vector<string> s(n);
    map<string, ll> num;
    rep(i,n) cin >> s[i], num[s[i]]++;
    ll count = 0;
    for(auto x, num){
      chmax(count, x.sc);
    }
    for(auto x, num){
      if(x.sc == count) print(x.fs);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:9: error: declaration of 'auto x' has no initializer
   76 |     for(auto x, num){
      |         ^~~~
a.cc:76:20: error: expected ';' before ')' token
   76 |     for(auto x, num){
      |                    ^
      |                    ;
a.cc:76:20: error: expected primary-expression before ')' token
a.cc:76:20: error: expected ';' before ')' token
   76 |     for(auto x, num){
      |                    ^
      |                    ;
a.cc:79:9: error: declaration of 'auto x' has no initializer
   79 |     for(auto x, num){
      |         ^~~~
a.cc:79:20: error: expected ';' before ')' token
   79 |     for(auto x, num){
      |                    ^
      |                    ;
a.cc:79:20: error: expected primary-expression before ')' token
a.cc:79:20: error: expected ';' before ')' token
   79 |     for(auto x, num){
      |                    ^
      |                    ;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   rep(i, n) {
      |       ^
a.cc:2:25: note: in definition of macro 'rep'
    2 | # define rep(i, n) for (i = 0; i < (n); i++)
      |                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
map<string,int> memo;
int main() {
  int N;
  cin >> N;
  for(int i=0;i<N;i++){
    string s;
    cin>>s;
    memo[s]++;
  }
  int max=0;
  for(const auto& x;memo){
    int v =x.second;
    if(v>max)max=v;
  }
  for(auto it=memo.begin();it !=memo.end();it++){
    if(it->secondn==max){
      cout<< it->first <<endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: declaration of 'const auto& x' has no initializer
   13 |   for(const auto& x;memo){
      |             ^~~~
a.cc:13:21: error: could not convert 'memo' from 'std::map<std::__cxx11::basic_string<char>, int>' to 'bool'
   13 |   for(const auto& x;memo){
      |                     ^~~~
      |                     |
      |                     std::map<std::__cxx11::basic_string<char>, int>
a.cc:13:25: error: expected ';' before ')' token
   13 |   for(const auto& x;memo){
      |                         ^
      |                         ;
a.cc:18:12: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 'secondn'; did you mean 'second'?
   18 |     if(it->secondn==max){
      |            ^~~~~~~
      |            second
Language: C++

#include <iostream>
using std::cin;
using std::cout;
using std::endl;

#include <map>
using std::map;

#include <string>
using std::string;

map<string, int> memo;

int main() {
    int n;
    cin >> n;
    for (int i=0;i<n;i++) {
        string s;
        cin >> s;
        memo[s] += 1;
    }

    int max_value = 0;
    for (const auto& x : memo) {
        if (x.second) max_value = x.second;
    }
    string names[n];
    int count = 0;
    for (auto it = memo.begin() ; it != memo.end() ; it++) {
        if (it->second == max_value) {
            names[count] = it->first;
            count += 1;
        }
    }
    if(count > 1) {
        sort(names, names+count);
    }
    
    for (int i=0; i<count; i++) {
        cout << names[i] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   36 |         sort(names, names+count);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
using std::cin;
using std::cout;
using std::endl;

#include <map>
using std::map;

#include <string>
using std::string;

map<string, int> memo;

int main() {
    int n;
    cin >> n;
    for (int i=0;i<n;i++) {
        string s;
        cin >> s;
        memo[s] += 1;
    }

    int max_value = 0;
    for (const auto& x : memo) {
        if (x.second) max_value = x.second;
    }

    for (auto it = memo.begin() ; it != memo.end() ; it++) {
        if (it->second == max+value) {
            cout << it->first << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: 'max' was not declared in this scope; did you mean 'std::max'?
   29 |         if (it->second == max+value) {
      |                           ^~~
      |                           std::max
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:29:31: error: 'value' was not declared in this scope
   29 |         if (it->second == max+value) {
      |                               ^~~~~
Language: C++

#include <iostream>
using std::cin;
using std::cout;
using std::endl;

#include <map>
using std::map;

#include <string>
using std::string;

map<string, int> memo;

int main() {
    int n;
    cin >> n;
    for (int i=0;i<n;i++) {
        string s;
        cin >> s;
        memo[s] += 1;
    }

    int max_value = 0;
    for (const auto& [key, value] : memo) {
        if (value > max_value) max_value = value;
    }

    for (auto it = memo.begin() ; it != memo.end() ; it++) {
        if (it->second == max+value) {
            cout << it->first << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: 'max' was not declared in this scope; did you mean 'std::max'?
   29 |         if (it->second == max+value) {
      |                           ^~~
      |                           std::max
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:29:31: error: 'value' was not declared in this scope
   29 |         if (it->second == max+value) {
      |                               ^~~~~
Language: C++

#include <iostream>
using std::cin;
using std::cout;
using std::endl;

#include <map>
using std::map;

#include <string>
using std::string;

map<string, int> memo;

int main() {
    int n;
    cin >> n;
    for (int i=0;i<n;i++) {
        string s;
        cin >> s;
        memo[s] += 1;
    }

    int max_value = 0;
    for (const auto& [key value] : memo) {
        if (value > max_value) max_value = value;
    }

    for (auto it = memo.begin() ; it != memo.end() ; it++) {
        if (it->second == max+value) {
            cout << it->first << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: expected ']' before 'value'
   24 |     for (const auto& [key value] : memo) {
      |                          ^~~~~~
      |                          ]
a.cc:24:22: error: only 1 name provided for structured binding
   24 |     for (const auto& [key value] : memo) {
      |                      ^
a.cc:24:22: note: while 'const std::pair<const std::__cxx11::basic_string<char>, int>' decomposes into 2 elements
a.cc:25:13: error: 'value' was not declared in this scope
   25 |         if (value > max_value) max_value = value;
      |             ^~~~~
a.cc:29:27: error: 'max' was not declared in this scope; did you mean 'std::max'?
   29 |         if (it->second == max+value) {
      |                           ^~~
      |                           std::max
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:29:31: error: 'value' was not declared in this scope
   29 |         if (it->second == max+value) {
      |                               ^~~~~
Language: C++

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

int main(){
	int n;cin >> n;
	map<string, int> mapa;
	for(int i=0;i<n;i++){
		string s;cin >> s;
		mapa[s]++;
	}
	for(auto i:map){
		if(i.second>1)
			cout << i.first << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: missing template arguments before ')' token
   11 |         for(auto i:map){
      |                       ^
Language: C++

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

int main() {

  int n;
  cin >> n;
  
  vector<string> name(n);
  for(int i=0; i<n; i++)
    cin >> name.at(i);
    
  sort(name.begin(),name.end())
  
  vector<int> vote(n);
  
  for(int i=0; i<n; i++) {
    for(int j=i;  j<n-1; j++){
      
      if(name.at(i) == name.at(j+1))
      	vote.at(i)++ ;
	else
	  break;
    }
  }
  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++){
 
      if(vote.at(i) < vote.at(j))
        break;
      if(j == n-1)
      cout << name.at(i) << endl;
    }
  }
  
}
      
   

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: expected ';' before 'vector'
   13 |   sort(name.begin(),name.end())
      |                                ^
      |                                ;
   14 | 
   15 |   vector<int> vote(n);
      |   ~~~~~~                        
a.cc:21:9: error: 'vote' was not declared in this scope
   21 |         vote.at(i)++ ;
      |         ^~~~
a.cc:29:10: error: 'vote' was not declared in this scope
   29 |       if(vote.at(i) < vote.at(j))
      |          ^~~~