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

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
  int n;
  scanf("%d",&n);
  char s[n+1][11];
  for(int i=0;i<n;i++){
    scanf("%s",s[i]);
  }
  
  qsort(s,n,sizeof(char)*11,strcmp);
  
  int max=-1;
  int count[n+1]={0};
  for(int i=0;i<n-1;i++){
	if(!strcmp(s[i],s[i+1])){
      count[i+1]=count[i]+1;
  	    if(count[i+1]>max)max=count[i+1];
    }
  }
  for(int i=0;i<n;i++){
    if(count[i]==max){
      printf("%s\n",s[i]);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:29: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   12 |   qsort(s,n,sizeof(char)*11,strcmp);
      |                             ^~~~~~
      |                             |
      |                             int (*)(const char *, const char *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(const char *, const char *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:15:18: error: variable-sized object may not be initialized except with an empty initializer
   15 |   int count[n+1]={0};
      |                  ^
Language: C++

#include<iostream>
#include<map>

using namespace std;

map<string, int>cnt;

int main()
{
    int t,max=0;

    cin>>t；
    while(t--)
    {
        string a;
        cin>>a;
        cnt[a]++;
        max=(max,cnt[a]);
    }
    for(auto p:cnt)
    {
        if(p.scond==max)
        {
            cout<< p.first <<endl;
        }

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 't\U0000ff1b' was not declared in this scope
   12 |     cin>>t；
      |          ^~~
a.cc:22:14: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 'scond'; did you mean 'second'?
   22 |         if(p.scond==max)
      |              ^~~~~
      |              second
Language: C++

#include<iostream>
#include<map>

using namespace std;

int main()
{
    int t,max=0;
    map<string int>cnt;
    cin>>t；
    while(t--)
    {
        string a;
        cin>>a;
        cnt[a]++;
        max=(max,cnt[a]);
    }
    for(auto p:cnt)
    {
        if(p.scond==max)
        {
            cout<< p.first <<endl;
        }

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: two or more data types in declaration of 'type name'
    9 |     map<string int>cnt;
      |         ^~~~~~
a.cc:9:19: error: wrong number of template arguments (1, should be at least 2)
    9 |     map<string int>cnt;
      |                   ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/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:10:10: error: 't\U0000ff1b' was not declared in this scope
   10 |     cin>>t；
      |          ^~~
a.cc:18:16: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   18 |     for(auto p: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:18:16: error: 'end' was not declared in this scope; did you mean 'std::end'?
   18 |     for(auto p: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;
      |                                     ^~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<map>
using namespace std;
int main()
{
    int t,max=0;
    map<string int>cnt;
    cin>>t；
    while(t--)
    {
        string a;
        cin>>a;
        cnt[a]++;
        max=(max,cnt[a]);
    }
    for(auto p:cnt)
    {
        if(p.scond==max)
        {
            cout<< p.first <<endl;
        }

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: two or more data types in declaration of 'type name'
    8 |     map<string int>cnt;
      |         ^~~~~~
a.cc:8:19: error: wrong number of template arguments (1, should be at least 2)
    8 |     map<string int>cnt;
      |                   ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:3:
/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:9:10: error: 't\U0000ff1b' was not declared in this scope
    9 |     cin>>t；
      |          ^~~
a.cc:17:16: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   17 |     for(auto p: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:2:
/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:17:16: error: 'end' was not declared in this scope; did you mean 'std::end'?
   17 |     for(auto p: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;
      |                                     ^~~
Language: C++

#include<stdio.h>
#include<iostream.h>
#include<map>
using namespace std;
int main()
{
    int t,max=0;
    map<string int>cnt;
    cin>>t；
    while(t--)
    {
        string a;
        cin>>a;
        cnt[a]++;
        max=(max,cnt[a]);
    }
    for(auto p:cnt)
    {
        if(p.scond==max)
        {
            cout<< p.first <<endl;
        }

    }
    return 0;
}


Compiler output:
a.cc:2:9: fatal error: iostream.h: No such file or directory
    2 | #include<iostream.h>
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
    int t,max=0;
    map<string int>cnt;
    cin>>t；
    while(t--)
    {
        string a;
        cin>>a;
        cnt[a]++;
        max=(max,cnt[a]);
    }
    for(auto p:cnt)
    {
        if(p.scond==max)
        {
            cout<<p.first<<endl;
        }

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'map' was not declared in this scope
    7 |     map<string int>cnt;
      |     ^~~
a.cc:3:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    2 | #include<iostream>
  +++ |+#include <map>
    3 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'int'
    7 |     map<string int>cnt;
      |                ^~~
a.cc:8:10: error: 't\U0000ff1b' was not declared in this scope
    8 |     cin>>t；
      |          ^~~
a.cc:16:16: error: 'cnt' was not declared in this scope; did you mean 'int'?
   16 |     for(auto p:cnt)
      |                ^~~
      |                int
Language: C++

#include <bits/stdc++.h>
using namespace std;
using lint = long;
using ll = long long;
#define rep(i,n) for(lint (i) = 0;(i) < (lint)(n);(i)++)
#define repInRange(i,start,end) for(lint (i) = (start);(i) < (end);++(i))
using lpair = pair<lint,lint>;
using vl = vector<lint>;
using vll = vector<long long>;
using Llist = list<lint>;
using vs = vector<string>;
#define all(v) (v).begin(),(v).end()
#define out(x) (cout << (x) << '\n');

ll pow(ll k,ll l) {
	ll ret = 1;
	rep(i,l) {
		ret *= k;
	}
	return ret;
}

template <typename T>
T sum(vector<T> vec) {
	ll ret = 0;
	rep(i,vec.size()) {
		ret += vec.at(i);
	}
	return ret;
}

void Main() {
	ll n;
	cin >> n;
	map<string,ll> m;
	vs s;
	rep(i,n) {
		string x;
		cin >> x;
		if (m.count(x)) {
			m[x]++;
		} else {
			m[x] = 1;
			s.push_back(x);
		}
	}
	ll max = m[s[0]],count = 0;
	rep(i,m.size()) {
		if (max < m[s[i]])
			max = m[s[i]];
	}
	rep(i,m.size()) {
		if (max == m[s[i]])
			count++;
	}
	vs ans;
	rep(i,m.size()) {
		if (max == m[s[i]])
			ans.push_back(s[i]);
	}
	sort(all(ans));
	rep(i,count) {
		out1(ans[i]);
	}
}

signed main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	Main();
	return 0;
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:63:17: error: 'out1' was not declared in this scope; did you mean 'out'?
   63 |                 out1(ans[i]);
      |                 ^~~~
      |                 out
Language: C


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct slist {
	char *name;
	int   cnt;
};

int main(void) {
	// 投票用紙の枚数
	int  N;
	scanf("%d",&N);

	char data[N][11]={0};
	int  i,j,cnt,sv_cnt,cmp;
	struct slist  list[N]={0};

	//投票用紙　入力
    for(i=0;i<N;i++) scanf("%s", data[i]);

    //候補者、獲得票数リストを作る
    list[0].name=data[0];
    list[0].cnt=1;
    cnt=1;sv_cnt=0;
    for(i=1;i<N;i++) {
        for(j=0;j<cnt;j++){
           cmp=strcmp(list[j].name,data[i]);
           if(cmp==0) break;
         }
         //名前があれば得票数をカウント
         if(cmp==0) {
           list[j].cnt++;
           if(sv_cnt<list[j].cnt)
        	  sv_cnt=list[j].cnt; //最大得票数
           continue;
         }
         //名前が無ければリストに候補者名を追加
         list[cnt].name=data[i];
         list[cnt].cnt=1;
         cnt++;

    }

  //得票数の多い候補者を集める
  char *name[cnt];
  for(i=0,j=0;i<cnt;i++){
	if(list[i].cnt==sv_cnt)
	  {name[j]=list[i].name;j++;}
  }
  cnt=j;//同率一位の数


  //辞書順に並べ替え
  char *tmp;
  int   k=cnt-1;

  for(j=0;j<k;j++){
     for(i=0;i<cnt-1;i++){
         cmp=strcmp(name[i],name[i+1]);
         if(cmp==1){
   	        tmp=name[i];
   	        name[i]=name[i+1];
   	        name[i+1]=tmp;
         }
       }
     k--;
  }

  for(i=0;i<cnt;i++)
     printf("%s\n",name[i]);
  return(0);
}


Compiler output:
main.c: In function 'main':
main.c:16:26: error: variable-sized object may not be initialized except with an empty initializer
   16 |         char data[N][11]={0};
      |                          ^
main.c:18:31: error: variable-sized object may not be initialized except with an empty initializer
   18 |         struct slist  list[N]={0};
      |                               ^
Language: C


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct slist {
	char *name;
	int   cnt;
};

int main(void) {
	// 投票用紙の枚数
	int  N;
	scanf("%d",&N);

	char data[N][11]={0};
	int  i,j,cnt,sv_cnt,cmp;
	struct slist  list[N]={0};

	//投票用紙　入力
    for(i=0;i<N;i++) scanf("%s", data[i]);

    //候補者、獲得票数リストを作る
    list[0].name=data[0];
    list[0].cnt=1;
    cnt=1;sv_cnt=0;
    for(i=1;i<N;i++) {
        for(j=0;j<cnt;j++){
           cmp=strcmp(list[j].name,data[i]);
           if(cmp==0) break;
         }
         //名前があれば得票数をカウント
         if(cmp==0) {
           list[j].cnt++;
           if(sv_cnt<list[j].cnt)
        	  sv_cnt=list[j].cnt; //最大得票数
           continue;
         }
         //名前が無ければリストに候補者名を追加
         list[cnt].name=data[i];
         list[cnt].cnt=1;
         cnt++;

    }

  //得票数の多い候補者を集める
  char *name[cnt];
  for(i=0,j=0;i<cnt;i++){
	if(list[i].cnt==sv_cnt)
	  {name[j]=list[i].name;j++;}
  }
  cnt=j;//同率一位の数


  //辞書順に並べ替え
  char *tmp;
  int   k=cnt-1;

  for(j=0;j<k;j++){
     for(i=0;i<cnt-1;i++){
         cmp=strcmp(name[i],name[i+1]);
         if(cmp==1){
   	        tmp=name[i];
   	        name[i]=name[i+1];
   	        name[i+1]=tmp;
         }
       }
     k--;
  }

  for(i=0;i<cnt;i++)
     printf("%s\n",name[i]);
  return(0);
}

Compiler output:
main.c: In function 'main':
main.c:16:26: error: variable-sized object may not be initialized except with an empty initializer
   16 |         char data[N][11]={0};
      |                          ^
main.c:18:31: error: variable-sized object may not be initialized except with an empty initializer
   18 |         struct slist  list[N]={0};
      |                               ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
map<string,int>cnt;
int main()
{
	int n;
	cin >>n;
	while(n--)
	{
		string a;
		cin>>a;
		cnt[a]++;
	}
	int k=0;
	for(map<string,int>::iterator it=cnt.begin();it!=cnt.end();it++)
	k=max(k,it.second);
	for(map<string,int>::iterator it=cnt.begin();it!=cnt.end();it++)
	if(k==it.second)
	cout<<it.first<<endl;
	

	return 0;
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: 'std::map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> > >::iterator'} has no member named 'second'
   21 |         k=max(k,it.second);
      |                    ^~~~~~
a.cc:23:18: error: 'std::map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> > >::iterator'} has no member named 'second'
   23 |         if(k==it.second)
      |                  ^~~~~~
a.cc:24:18: error: 'std::map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> > >::iterator'} has no member named 'first'
   24 |         cout<<it.first<<endl;
      |                  ^~~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;

int main() {
    int n;
    cin >> n;
    string tmp;

    unordered_map<string, int> s;
    set<string> l;

    rep(i, n) {
        cin >> tmp;
        s[tmp]++;
        l.insert(tmp);
    }

    for (auto itr = l.begin(); itr != l.end(); itr++) {
        max_cnt = max(max_cnt, s[*itr]);
    }

    cout << max_cnt << endl;
    for (auto itr = l.begin(); itr != l.end(); itr++) {
        if (s[*itr] == max_cnt) cout << *itr << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'max_cnt' was not declared in this scope
   22 |         max_cnt = max(max_cnt, s[*itr]);
      |         ^~~~~~~
a.cc:25:13: error: 'max_cnt' was not declared in this scope
   25 |     cout << max_cnt << endl;
      |             ^~~~~~~
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
using namespace std;
int cmp(const void*a,const void*b)
{
    return strcmp((char*)a,(char*)b);
}
int main()
{
	int n,i,j,N=11,max=-99;
	char *str[10010],temp[11];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		str[i]=(char *)malloc(N*sizeof(char));
		scanf("%s",str[i]);
	}	
	qsort(str,n,sizeof(str[0]),cmp);
	int c=1;
	for(i=0;i<n-1;i++)
	{
		if(strcmp(str[i],str[i+1])==0)
		{
			c++;
		}		
		else 
		{
		  if(max<c)
			{
				max=c;
			}			  
		  c=1;
		}
	}
	if(max<c)
	{
		max=c;
	}		
	c=1;
	for(i=0;i<n-1;i++)
	{
		if(strcmp(str[i],str[i+1])==0)
		{
			c++;
		}		
		else 
		{
		  if(max==c)
			{
				printf("%s\n",str[i]);
			}			  
		  c=1;
		}
	}
	if(c==max)
	puts(str[n-1]);
	return 0;
}

Compiler output:
main.c:4:9: fatal error: iostream: No such file or directory
    4 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
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]+=1;//文字入れカウンター
    }
    int kazu =0;
    for(const auto& x : memo)//memoの要素分やる
    {
        int v =x.second;
        if(v> kazu)kazu=v;

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


}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
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]+=1;//文字入れカウンター
    }
    int kazu =0;
    for(const auto& x : memo)//memoの要素分やる
    {
        int v =x.secondl;
        if(v> kazu)kazu=v;

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


}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'const struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 'secondl'; did you mean 'second'?
   15 |         int v =x.secondl;
      |                  ^~~~~~~
      |                  second
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
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]+=1;//文字入れカウンター
    }
    int kazu =0;
    for(const auto& x : memo)//memoの要素分やる
    {
        int v =x.secondl;
        if(v> kazu)kazu=v;

    }
    for(auto it =memo.begin();it!=memo.end();it++){
        if(it->second==kazu){
        cout << x->first << endl;
    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'const struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 'secondl'; did you mean 'second'?
   15 |         int v =x.secondl;
      |                  ^~~~~~~
      |                  second
a.cc:21:17: error: 'x' was not declared in this scope
   21 |         cout << x->first << endl;
      |                 ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>

using namespace std;

int main() {

    int N;
    cin >> N;
    int a[N];
    for(int i=0;i<N;i++) a[i] = 0;
    string b[N];
    int count = 0;
    for(int i=0;i<N;i++){
        string S;
        cin >> S;
        bool exist = false;
        for(int j=0;j<N;j++){
            if(S == b[j]){
                b[j] = S;
                a[j]++;
                exist = true;
                break;
            }
        }
        if(exist == false){
            b[count] = S;
            count ++;
        }
    }
    int max = 0;
    for(int i=0;i<N;i++){
        if(max < a[i]) max = a[i];
    }
    string out[N];
    count = 0;
    for(int i=0;i<N;i++){
        if(max == a[i]){
            out[count] = b[i];
            count++;
        }
    }
    sort(out,out+count);
    for(int i=0;i<count;i++){
        cout << out[i] << endl;
    }
    return 0;
}


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

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

int main()
{
  int n;
  cin >> n;
  vector<string> vec(n);
  for(int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  
  int ichii = 1;
  while(ichii < n && vec.at(0) == vec.at(ichii) {
      ichii++;
  }
  int pla = 0;
  while(pla + ichii - 1 < n) {
    if(vec.at(pla) == vec.at(pla + ichii - 1)) {
      cout << vec.at(pla) << endl;
      pla += ichii;
    }
    else {
      pla = n;
    }
  }
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:48: error: expected ')' before '{' token
   16 |   while(ichii < n && vec.at(0) == vec.at(ichii) {
      |        ~                                       ^~
      |                                                )
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>

const char *anss(bool b)
{
	return b ? "Yes" : "No";
}

const char *ansp(bool b)
{
	return b ? "APPROVED" : "DENIED";
}

bool mstrcmp(const char* l, const char *r)
{
	return std::strcmp(l, r) < 0;
}
using mymap = std::map<const char*, int, decltype(&mstrcmp)>;
using myv = const mymap::value_type&;

int main()
{
	int N;
	std::cin >> N;
	std::vector<char[16]> S(N);
	for (int i = 0; i < N; i++)
	{
		std::cin >> S[i];
	}

	mymap bucket(&mstrcmp);
	for (int i = 0; i < N; i++)
	{
		bucket[S[i]]++;
	}

	auto max_S = std::max_element(begin(bucket), end(bucket), [](myv l, myv r) { return l.second < r.second; });
	int max_vote = max_S->second;

	std::vector<std::string> answers;
	for (auto it = begin(bucket); it != end(bucket); it++)
	{
		if (it->second == max_vote)
		{
			std::cout << it->first << std::endl;
		}
	}
}

Compiler output:
a.cc: In function 'bool mstrcmp(const char*, const char*)':
a.cc:19:21: error: 'strcmp' is not a member of 'std'
   19 |         return std::strcmp(l, r) < 0;
      |                     ^~~~~~
Language: C++

/*** keep hungry and calm CoolGuang!***/
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#include<stdio.h>
#include<algorithm>
#define debug(x) cout<<#x<<":"<<x<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
const ll INF=1e18;
const int maxn=1e6+18;
const int mod=1000007;
inline bool read(ll &num)
{char in;bool IsN=false;in=getchar();if(in==EOF) return false;while(in!='-'&&(in<'0'||in>'9')) in=getchar();if(in=='-'){ IsN=true;num=0;}else num=in-'0';while(in=getchar(),in>='0'&&in<='9'){num*=10,num+=in-'0';}if(IsN) num=-num;return true;}
ll n,m,p;
ll num[maxn];
char str[maxn][15];
unsigned long long H[maxn];
int mp[maxn];
set<string>st;
unordered_map<unsigned long long,int>mp;
unordered_map<unsigned long long,int>vis;
string s[maxn];
int main()
{
    read(n);
    int maxl=0;
    for(int i=1;i<=n;i++){
        scanf("%s",str[i]);
        int len=strlen(str[i]);
        ll Hash=0;
        for(int k=0;k<len;k++){
            Hash=Hash*2333+str[i][k]-'a';
            s[i].push_back(str[i][k]);
        }
        maxl=max(maxl,++mp[Hash]);
        H[i]=Hash;
    }
    int cnt=0;
    for(int i=1;i<=n;i++){
        int x=mp[H[i]];
        if(x==maxl){
            if(!vis[H[i]]){
                st.insert(s[i]);
                vis[H[i]]=1;
            }
        }
    }
    for(auto x:st) cout<<x<<endl;
    return 0;
}
/***

***/


Compiler output:
a.cc:21:38: error: conflicting declaration 'std::unordered_map<long long unsigned int, int> mp'
   21 | unordered_map<unsigned long long,int>mp;
      |                                      ^~
a.cc:19:5: note: previous declaration as 'int mp [1000018]'
   19 | int mp[maxn];
      |     ^~
Language: C++

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
map<string,int>mp;
int main()
{
    std::ios::sync_with_stdio(false);
    int n;
    cin>>n;
    int max1=0;
    for(int i=1;i<=n;i++)
    {
        string a;
        cin>>a;
        mp[a]++;
        max1=max(max1,mp[a]);
        w.insert(a);
    }
    set<string> ::iterator it=w.begin();
    for(;it!=w.end();it++)
    {
        if(mp[*it]==max1)
            cout<<*it<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'w' was not declared in this scope
   18 |         w.insert(a);
      |         ^
a.cc:20:31: error: 'w' was not declared in this scope
   20 |     set<string> ::iterator it=w.begin();
      |                               ^
Language: C++

 <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    int N;cin >> N;
    map<string,int> mp;
    for (int i = 1; i< N;i++){
        string s;cin >> s;
        mp[s]++;
    }
    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:1:2: error: expected unqualified-id before '<' token
    1 |  <bits/stdc++.h>
      |  ^
a.cc: In function 'int main()':
a.cc:6:11: error: 'cin' was not declared in this scope
    6 |     int N;cin >> N;
      |           ^~~
a.cc:7:5: error: 'map' was not declared in this scope
    7 |     map<string,int> mp;
      |     ^~~
a.cc:7:9: error: 'string' was not declared in this scope
    7 |     map<string,int> mp;
      |         ^~~~~~
a.cc:7:16: error: expected primary-expression before 'int'
    7 |     map<string,int> mp;
      |                ^~~
a.cc:9:15: error: expected ';' before 's'
    9 |         string s;cin >> s;
      |               ^~
      |               ;
a.cc:9:25: error: 's' was not declared in this scope
    9 |         string s;cin >> s;
      |                         ^
a.cc:10:9: error: 'mp' was not declared in this scope
   10 |         mp[s]++;
      |         ^~
a.cc:13:19: error: 'mp' was not declared in this scope; did you mean 'p'?
   13 |     for (auto p : mp) mx = max(mx,p.second);
      |                   ^~
      |                   p
a.cc:13:28: error: 'max' was not declared in this scope; did you mean 'mx'?
   13 |     for (auto p : mp) mx = max(mx,p.second);
      |                            ^~~
      |                            mx
a.cc:14:19: error: 'mp' was not declared in this scope; did you mean 'p'?
   14 |     for (auto p : mp){
      |                   ^~
      |                   p
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << p.first << endl;
      |         ^~~~
a.cc:16:28: error: 'endl' was not declared in this scope
   16 |         cout << p.first << endl;
      |                            ^~~~
Language: C++

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

int main(){
    int N;
    cin>>N;
    map<string, int> data;
    for(int i=0;i<N;i++){
        string s;
        cin>>s;
        data[s]+=1;
    }
    int datamax=0;
    for(auto d:data){
        datamax=max(datamax,d.second);   
    }
    vector<string> ans;
    for(auto d:data){
        if (d.second == datamax) {
            ans.push_back(d.first);
    }
  }
  
  sort(ans.begin(), ans.end());
  
  for (auto a:ans) {
    cout << a << endl;
  }
  
  return 0;
    }
}

Compiler output:
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

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

int main(){
    int N;
    cin>>N;
    map<string, int> data;
    for(int i=0;i<N;i++){
        string s;
        cin>>s;
        data[s]+=1;
    }
    int datamax=0;
    for(auto d;data){
        datamax=max(datamax,d.second);   
    }
    vector<string> ans;
    for(auto d;data){
        if (d.second == d_max) {
            ans.push_back(d.first);
    }
  }
  
  sort(ans.begin(), ans.end());
  
  for (auto a : ans) {
    cout << a << endl;
  }
  
  return 0;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: declaration of 'auto d' has no initializer
   18 |     for(auto d;data){
      |         ^~~~
a.cc:18:16: error: could not convert 'data' from 'std::map<std::__cxx11::basic_string<char>, int>' to 'bool'
   18 |     for(auto d;data){
      |                ^~~~
      |                |
      |                std::map<std::__cxx11::basic_string<char>, int>
a.cc:18:20: error: expected ';' before ')' token
   18 |     for(auto d;data){
      |                    ^
      |                    ;
a.cc:22:9: error: declaration of 'auto d' has no initializer
   22 |     for(auto d;data){
      |         ^~~~
a.cc:22:16: error: could not convert 'data' from 'std::map<std::__cxx11::basic_string<char>, int>' to 'bool'
   22 |     for(auto d;data){
      |                ^~~~
      |                |
      |                std::map<std::__cxx11::basic_string<char>, int>
a.cc:22:20: error: expected ';' before ')' token
   22 |     for(auto d;data){
      |                    ^
      |                    ;
a.cc:23:25: error: 'd_max' was not declared in this scope; did you mean 'datamax'?
   23 |         if (d.second == d_max) {
      |                         ^~~~~
      |                         datamax
a.cc: At global scope:
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  map<string,int> dic;
  for(int i=0;i<n;i++){
    string s;
    cin >> s;
    dic[s] += 1;
  }
  int max1 = 0;
  for(int i:dic){
    int v = i.second();
    max1 = max(max1,v);
  }
  for(auto it = memo.begin();it!=memo.end();it++){
    cout << 
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: cannot convert 'std::pair<const std::__cxx11::basic_string<char>, int>' to 'int' in initialization
   14 |   for(int i:dic){
      |             ^~~
a.cc:15:15: error: request for member 'second' in 'i', which is of non-class type 'int'
   15 |     int v = i.second();
      |               ^~~~~~
a.cc:18:17: error: 'memo' was not declared in this scope
   18 |   for(auto it = memo.begin();it!=memo.end();it++){
      |                 ^~~~
a.cc:20:3: error: expected primary-expression before '}' token
   20 |   }
      |   ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int	main(void)
{
  	int		N;
  	char	**s;
  	char	**t;
  	char    *temp;
  	int     tmp;
  	int		*v;
  	int     *u;
  	int		num;
  	int		i;
  	int		j;
  	int     k;
  	int		max;
  	int		count;
  	int     king;
  
  	num = scanf("%d", &N);
  	if (num != 1)
      	return (0);
  	
  	temp = (char *)mallloc(sizeof(char) * 10);
  	v = (int *)malloc(sizeof(int) * N);
  	s = (char **)malloc(sizeof(char *) * N);
   	for (i = 0; i < N; i++)
    {
      	s[i] = (char *)malloc(sizeof(char) * 10);
      	num = scanf("%s", s[i]);
      	if (num != 1)
          	return (0);
      	v[i] = 1;
    }
  	
  	for (i = 0; i < N; i++)
    {
      	for (j = i + 1; j < N; j++)
        {
          	if (strcmp(s[i], s[j]) == 0)
            {
                if (v[j] == 0)
                    continue ;
              	v[i] = v[i] + v[j];
              	v[j] = 0;
            }
        }
    }
  
  	max = 0;
  	for (i = 0; i < N; i++)
    {
      	if (v[i] > max)
          	max = v[i];
    }
  	count = 0;
  	for (i = 0; i < N; i++)
    {
      	if (v[i] == max)
        {
            count++;
          	king = i;
        }
    }
    if (count == 1)
    {
        printf("%s\n", s[king]);
        return (0);
    }
    
    u = (int *)malloc(sizeof(int) * count);
  	t = (char **)malloc(sizeof(char *) * count);
  	for (i = 0; i < count; i++)
      	t[i] = (char *)malloc(sizeof(char) * 10);
  
  	k = 0;
  	for (i = 0; i < N; i++)
    {
      	if (v[i] == max)
      	{
          	t[k] = s[i];
          	k++;
      	}
    }
    for (i = 0; i < count; i++)
        u[i] = i;
  	for (i = 0; i < count; i++)
    {
      	for (j = i + 1; j < count; j++)
        {
          	if (strcmp(t[i], t[j]) > 0)
            {
              	temp = t[i];
          		t[i] = t[j];
          		t[j] = temp;
            }
        }
    }

  	for (i = 0; i < count; i++)
    {
	  	printf("%s\n", t[u[i]]);
    }
  	return (0);
}
          
  	
          	

Compiler output:
main.c: In function 'main':
main.c:26:24: error: implicit declaration of function 'mallloc'; did you mean 'malloc'? [-Wimplicit-function-declaration]
   26 |         temp = (char *)mallloc(sizeof(char) * 10);
      |                        ^~~~~~~
      |                        malloc
main.c:26:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   26 |         temp = (char *)mallloc(sizeof(char) * 10);
      |                ^
Language: C++

#include <iostream>
#include <map>
#include <vector>

using namespace std;

const int MAX = 2e5;


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

    map<string, int> freq;


    int most = 0;
    string s;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        auto it = freq.find(s);
        if (it == freq.end()) {
            it = freq.insert({s, 0}).first;

        }
        it->second++;
        most = max(most, it->second);
    }

    vector<string> ret;
    for (auto itr = freq.begin(); itr != freq.end(); ++itr) {
        if (itr->second == most) {
            ret.push_back(itr->first);
        }
    }

    sort(ret.begin(), ret.end());
    for (auto s : ret) {
        cout << s << "\n";
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   37 |     sort(ret.begin(), ret.end());
      |     ^~~~
      |     short
Language: C++

import java.util.Scanner;
import java.util.HashMap;
import java.util.Map;
import java.util.Collections;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.lang.Math;

public class Main {

    private static Scanner sc = new Scanner(System.in);
    private static int mod = (int) 10e8 + 7;

    public static void main(String[] args) {
        int n = sc.nextInt();
        Map<String, Integer> strings = new HashMap<String, Integer>();
        String s;
        for (int i = 0; i < n; i++) {
            s = sc.next();
            if (strings.containsKey(s)) {
                strings.put(s, strings.get(s)+1);
            } else {
                strings.put(s, 1);
            }
        }
        int max = Integer.MIN_VALUE;
        for (int i : strings.values()) {
            if (i > max) max = i;
        }
        for (Map.Entry<String, Integer> ans : strings.entrySet()) {
            if (ans.getValue() == max) {
                System.out.println(ans.getKey());
            }
        }
    }

}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.HashMap;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.Map;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Collections;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.List;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.util.Arrays;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import java.util.ArrayList;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: 'import' does not name a type
    8 | import java.lang.Math;
      | ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:1: error: expected unqualified-id before 'public'
   10 | public class Main {
      | ^~~~~~
Language: C++

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

int N;
string s;
vector<pair<string, int> > v;
vector<string> ans;
map<string, int> m;

bool cmp(pair<string, int> a, pair<string, int> b) {
    if (a.second == b.second) {
        return a.first < b.first;
    }
    return a.second > b.second;
}

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> s;
        m[s] += 1;
    }
    map<string, int>::iterator it = m.begin();
    for (; it != m.end(); it++) {
        v.push_back(pair<string, int>(it->first, it->second));
    }
    sort(v.begin(), v.end(), cmp);
    int maxn = v.begin()->second;
    for (it = m.begin(); it != m.end(); it++) {
        if (it->second == maxn) {
            ans.push_back(it->first);
        }
    }
    vector<string>::iterator it_ans = ans.begin();
    for (; it_ans != ans.end(); it_ans++) {
        cout << *it_ans << endl;
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   29 |     sort(v.begin(), v.end(), cmp);
      |     ^~~~
      |     short
Language: C++

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

int main(void)
{
    int N;
    cin >> N;
    unordered_map<string, int> d;

    for (int i = 0; i < N; i++)
    {
        string s;
        d[s]++;
    }

    int mx = 0;
    for (auto p : d)
    {
        mx = max(mx, p.second)
    }
    for (auto p : d)
    {
        if (p.second == mx)
        {
            cout << p.first << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:31: error: expected ';' before '}' token
   19 |         mx = max(mx, p.second)
      |                               ^
      |                               ;
   20 |     }
      |     ~
Language: C++

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.IOException;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main
      | ^~~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class C
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    }
}


Compiler output:
Main.java:6: error: class C is public, should be declared in a file named C.java
public class C
       ^
1 error
Language: C++

nclude <bits/stdc++.h>
using namespace std;
#define int long long
 
map<string, int> f;
 
main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, mf = 0;
	string s;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> s;
		f[s]++;
		mf = max(mf, f[s]);
	}
	for (auto i : f)
		if (i.second == mf) cout << i.first << '\n';
}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude <bits/stdc++.h>
      | ^~~~~~
a.cc:5:1: error: 'map' does not name a type
    5 | map<string, int> f;
      | ^~~
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'ios' has not been declared
    8 |         ios::sync_with_stdio(0);
      |         ^~~
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin.tie(0);
      |         ^~~
a.cc:11:9: error: 'string' was not declared in this scope
   11 |         string s;
      |         ^~~~~~
a.cc:14:24: error: 's' was not declared in this scope
   14 |                 cin >> s;
      |                        ^
a.cc:15:17: error: 'f' was not declared in this scope
   15 |                 f[s]++;
      |                 ^
a.cc:16:22: error: 'max' was not declared in this scope
   16 |                 mf = max(mf, f[s]);
      |                      ^~~
a.cc:18:23: error: 'f' was not declared in this scope
   18 |         for (auto i : f)
      |                       ^
a.cc:19:37: error: 'cout' was not declared in this scope
   19 |                 if (i.second == mf) cout << i.first << '\n';
      |                                     ^~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int cnt[200001];
int main(void){
    int n,i,max=0;
    char s[200001][11];
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%s",s[i]);
    qsort(s,n,11,strcmp);
    cnt[0]=1;
    for(i=1;i<n;i++){
        if(strcmp(s[i-1],s[i])==0){
            cnt[i]=cnt[i-1]+1;
        }
        else{
            cnt[i]=1;
            if(max<cnt[i-1]) max=cnt[i-1];
        }
    }
    if(max<cnt[n-1]) max=cnt[n-1];
    for(i=0;i<n;i++){
        if(cnt[i]==max) printf("%s\n",s[i]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:18: error: 'strcmp' undeclared (first use in this function)
    9 |     qsort(s,n,11,strcmp);
      |                  ^~~~~~
main.c:3:1: note: 'strcmp' is defined in header '<string.h>'; this is probably fixable by adding '#include <string.h>'
    2 | #include <stdlib.h>
  +++ |+#include <string.h>
    3 | int cnt[200001];
main.c:9:18: note: each undeclared identifier is reported only once for each function it appears in
    9 |     qsort(s,n,11,strcmp);
      |                  ^~~~~~
main.c:12:12: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   12 |         if(strcmp(s[i-1],s[i])==0){
      |            ^~~~~~
main.c:12:12: note: include '<string.h>' or provide a declaration of 'strcmp'
Language: Java


import java.util.*;

public class C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String, Integer> votes = new HashMap<>();
        int gothru = sc.nextInt();
        int max = -999;
        for (int i = 0; i<gothru;i++) {
            String cur = sc.next();
            if (votes.containsKey(cur)) {
                int was = votes.get(cur);
                votes.put(cur, was+1);
                if ((was + 1) > max) {
                    max = (was + 1);
                }
            } else {
                votes.put(cur, 1);
            }
        }
        ArrayList<String> toprint = new ArrayList<>();
        for (Map.Entry<String, Integer> e : votes.entrySet()) {
            if (e.getValue() == max) {
                toprint.add(e.getKey());
            }
        }
        Collections.sort(toprint);
        for (int i = 0; i<toprint.size(); i++) {
            System.out.println(toprint.get(i));
        }
    }
}


Compiler output:
Main.java:4: error: class C is public, should be declared in a file named C.java
public class C {
       ^
1 error
Language: Java


import java.util.*;

public class C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String, Integer> votes = new HashMap<>();
        int gothru = sc.nextInt();
        int max = -999;
        for (int i = 0; i<gothru;i++) {
            String cur = sc.next();
            if (votes.containsKey(cur)) {
                int was = votes.get(cur);
                votes.put(cur, was+1);
                if ((was + 1) > max) {
                    max = (was + 1);
                }
            } else {
                votes.put(cur, 1);
            }
        }
        for (Map.Entry<String, Integer> e : votes.entrySet()) {
            if (e.getValue() == max) {
                System.out.println(e.getKey());
            }
        }
    }
}


Compiler output:
Main.java:4: error: class C is public, should be declared in a file named C.java
public class C {
       ^
1 error
Language: C++

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

int main() {
  int N;
  cin >> N;

  string S;
  map<string, int> mp;
  int counter = 0;
  for (int i=0; i<N; i++) {
    cin >> S;
    if(mp.find(S) != mp.end()) {
      mp[S] += 1;
    } else {
      mp[S] = 0;
    }
    if (mp[S] > counter) {
      counter = mp[s];
    }
  }

  for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
    if (itr->second == counter) {
      cout << itr->first << endl;
    }
  }
   
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: 's' was not declared in this scope
   19 |       counter = mp[s];
      |                    ^
a.cc:29:11: error: 'res' was not declared in this scope
   29 |   cout << res << endl;
      |           ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;

class str{
public:
  string s;
  int n = 0;
};

int main(){
  int n; cin >> n;
  str *ss;
  ss = (str *)malloc(sizeof(str) * n);
  int sum = 0;
  for(int i = 0; i < n; i++){
    string si; cin >> si;
    int j;
    for(j = 0; j < sum; j++){
      if(ss[j].s.compare(si) == 0) break;
    }
    if(j == sum){
      ss[j].s = si;
      ss[j].n++;q
      sum++;
    }
    else ss[j].n++;
  }

  for(int i = n; i >= 0; i--){
    vector<string> v;
    for(int j = 0; j < sum; j++){
      if(ss[j].n == i) v.push_back(ss[j].s);
    }
    sort(v.begin(), v.end());
    for(int k = 0; k < v.size(); k++){
      cout << v[k] << endl;
    }
    if(v.size() > 0) break;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'q' was not declared in this scope
   26 |       ss[j].n++;q
      |                 ^