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

#include <bits/stdc++.h>
#include <string>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
const int INF = 1001001001;


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

    vector<string> S(N);
    set<string> SS;

    REP(i,N)
    {
        cin >> S[i];
        SS.insert(S[i]);
    }

    int cot = 0;
    int max_cot = 1;
    queue<string> que;
    for (auto x : SS) {
        cot = count(S.begin(), S.end(), x);
        if(cot == max_cot) {
            que.push(x);
        } else if (cot >= max_cot) {
            max_cot = cot;
            queue<string> empty;
            swap(que, empty);
            que.push(x);
        }
    }

    set<int> j = que.rbegin();

    
    while(!j.empty()) {
        cout << j.front() << endl;
        que.pop();
    }

    return 0;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:22: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'rbegin'
   40 |     set<int> j = que.rbegin();
      |                      ^~~~~~
a.cc:44:19: error: 'class std::set<int>' has no member named 'front'
   44 |         cout << j.front() << endl;
      |                   ^~~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<cmath>
#include<string.h>
#include<algorithm>
#include<set>
#include<cstring>
using namespace std;

string s[200005];
int num[200005];

bool cmp(string a,string b)
{
	if(a.length()==b.length())
        return a.compare(b)<1;
    return a.length()<b.length();
}

int main()
{	
	int n;
	scanf("%d", &n);
	int max = 1, cnt = 0;
	string str;
	bool b=true;
	while(n--){
		cin >> str;
		b=true;
		for(int i=0; i<cnt; i++){
			if(s[i]==str){
				num[i]++;
				if(num[i]>max)	max = num[i];
				b=false;
				break;
			}
		}
		if(b){
			s[cnt]=str;
			num[cnt++] = 1;
		}
	}
	sort(s,s+cnt,comp);
	for(int i=0; i<cnt; i++){
		if(num[i]==max){
			cout << s[i] << endl;
		}
	}
	return 0;	
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:43:22: error: 'comp' was not declared in this scope; did you mean 'cmp'?
   43 |         sort(s,s+cnt,comp);
      |                      ^~~~
      |                      cmp
Language: Java

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

int main() {
    // 頂点数 (木なので辺数は N-1 で確定)
    int n;
cin >> n;
string data[n];
set<string> lists;
for(int i=0;i<n;i++){
 cin >> data[i];
lists.insert(data[i]);
}
sort(lists,lists+n);
vector<tuple<string,int>> c; 
int big=0;

map<string,int> ma;


for(string temp:lists){
int num=0;
int flag=0;
for(string datemp:data){
if(temp.compare(datemp)==0){num++;
flag=1;
}
if(flag==1 && temp.compare(datemp)==1){
flag=0;
break;
}
}
ma[temp]=num;
if(big<num)big=num;
}

vector<string> result; 

for(string temp:lists){

if(big==ma[temp])result.push_back(temp);
}


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

for(string te:result)
cout <<te <<"\n" ;

}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:2: error: illegal character: '#'
#include <iostream>
^
Main.java:3: error: illegal character: '#'
#include <list>
^
Main.java:4: error: illegal character: '#'
#include <string>
^
Main.java:5: error: illegal character: '#'
#include <algorithm>
^
Main.java:11: error: not a statement
cin >> n;
    ^
Main.java:12: error: not a statement
string data[n];
            ^
Main.java:15: error: not a statement
 cin >> data[i];
     ^
Main.java:52: error: not a statement
cout <<te <<"\n" ;
          ^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:12: error: ';' expected
string data[n];
             ^
12 errors
Language: C++

#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
int main()
{
  int N;
  string word;
  vector<string> &vector;
  scanf("%d\n",&N);
  for(int i=0;i<N;i++){
  	scanf("%s", word);
    vector.push_back(word);
  }
  sort(vector.begin(),vector.end());
  for(int i = 0; i< 3; i++){
    printf("%s",vector[i]);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'vector' declared as reference but not initialized
   11 |   vector<string> &vector;
      |                   ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define sz(a) int(a.size())
#define re return
using namespace std;
string s[100005];
int main()
{
	map<string,int>mp;
	int n;
	cin>>n;
	for (int i=0;i<n;i++)
	{
		cin>>s[i];
		if (!mp.find(s[i]))  mp[s[i]]=0;
		mp[s[i]]++;
	}
	int best=0;
	for (int i=0;i<n;i++)  best=max(best,mp[s[i]]);
	vector<string>ans;
	for (int i=0;i<n;i++)  if (mp[s[i]]==best)  ans.pb(s[i]);
	sort(ans.begin(),ans.end());
	for (int i=0;i<sz(ans);i++)  cout<<ans[i];
	re 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: no match for 'operator!' (operand type is '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'})
   15 |                 if (!mp.find(s[i]))  mp[s[i]]=0;
      |                     ^~~~~~~~~~~~~~
a.cc:15:21: note: candidate: 'operator!(bool)' (built-in)
a.cc:15:21: note:   no known conversion for argument 1 from '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'} to 'bool'
Language: C++

#include <string.h>
#include <vector>
using namespace std;
int main()
{
  int N;
  string word;
  vector<string> vector;
  scanf("%d\n",&N);
  for(int i=0;i<N;i++){
  	scanf("%s", word);
    vector.push_back(word);
  }
  sort(vector.begin(),vector.end());
  for(int i = 0; i< 3; i++){
    printf("%s",vector[i]);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string word;
      |   ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include <vector>
  +++ |+#include <string>
    3 | using namespace std;
a.cc:8:16: error: template argument 2 is invalid
    8 |   vector<string> vector;
      |                ^
a.cc:9:3: error: 'scanf' was not declared in this scope
    9 |   scanf("%d\n",&N);
      |   ^~~~~
a.cc:11:21: error: 'word' was not declared in this scope
   11 |         scanf("%s", word);
      |                     ^~~~
a.cc:12:12: error: request for member 'push_back' in 'vector', which is of non-class type 'int'
   12 |     vector.push_back(word);
      |            ^~~~~~~~~
a.cc:14:15: error: request for member 'begin' in 'vector', which is of non-class type 'int'
   14 |   sort(vector.begin(),vector.end());
      |               ^~~~~
a.cc:14:30: error: request for member 'end' in 'vector', which is of non-class type 'int'
   14 |   sort(vector.begin(),vector.end());
      |                              ^~~
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(vector.begin(),vector.end());
      |   ^~~~
      |   short
a.cc:16:23: error: invalid types 'int[int]' for array subscript
   16 |     printf("%s",vector[i]);
      |                       ^
a.cc:16:5: error: 'printf' was not declared in this scope
   16 |     printf("%s",vector[i]);
      |     ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <vector>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

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

struct node{
	string name;
	int sum;
}a[200005];
bool check(string x,string y)
{
	if(x.size()!=y.size())
		return false;
	for(int i=1; i)
			return false;
	}<=x.size(); i++)
	{
		if(x[i]!=y[i]
	return true;
}
int main()
{
	int n,i,j,v=0,t=0;
	cin>>n;
	string b[n+1];
	for(i=1; i<=n; i++)
		cin>>a[i].name;
	for(i=1; i<=n; i++)
	{
		for(j=1; j<i; j++)
			if(check(b[j],a[i].name))
			{
				a[j].sum++;
				a[i].name="";
			}
			else
			{
				t++;
				b[t]=a[i].name;
			}
	}
	for(i=1; i<=n; i++)
		if(a[i].sum>v)
			v=a[i].sum;
	sort(b+1,b+n+1);
	for(i=1; i<=n; i++)
		if(a[i].sum==v)
			cout<<a[i].name<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool check(std::string, std::string)':
a.cc:12:23: error: expected ';' before ')' token
   12 |         for(int i=1; i)
      |                       ^
      |                       ;
a.cc: At global scope:
a.cc:14:10: error: expected unqualified-id before '<=' token
   14 |         }<=x.size(); i++)
      |          ^~
a.cc:14:22: error: 'i' does not name a type
   14 |         }<=x.size(); i++)
      |                      ^
a.cc: In function 'bool check(std::string, std::string)':
a.cc:14:9: warning: control reaches end of non-void function [-Wreturn-type]
   14 |         }<=x.size(); i++)
      |         ^
Language: C++

n=int (input())
s = [input() for i in range(n-1)]


from collections import Counter 


def most_frequent(s): 

    occurence_count = Counter(s) 

    return occurence_count.most_common(1)[0][0] 

 

print(sorted(most_frequent(s)) )


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int (input())
      | ^
Language: C++

#include<cstring>
using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    int num[201100], i , sum = 0, j;
    char a[201100][11], b[201100][11];
    char ans[11];
    while(n--)
    {
        scanf("%s",a[sum]);
        for(j = 0; j < sum; j ++)
        {
            if(strcmp(a[sum],a[j]) == 0){
                num[j]++;break;
            }
        }
        if(j < sum) continue;
        num[sum]++,sum++;
    }
    int max1 = -1, k = 0, aim;
    for(i = 0; i <= sum; i++)  max1 = max(max1,num[i]);
    for(i = 0; i <= sum; i++)  if(num[i] == max1) strcpy(b[k++],a[i]);

    for(i = 0; i < k - 1; i++)
    {
        aim = i;
        for(j = i + 1; j < k; j++)
        {
            if(strcmp(b[i],b[j]) > 0) aim = j;
        }
        strcpy(ans,b[i]),strcpy(b[i],b[aim]),strcpy(b[aim],ans);
        cout << b[i] << endl;
    }
    cout << b[k-1] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'scanf' was not declared in this scope
    7 |     scanf("%d",&n);
      |     ^~~~~
a.cc:24:39: error: 'max' was not declared in this scope; did you mean 'max1'?
   24 |     for(i = 0; i <= sum; i++)  max1 = max(max1,num[i]);
      |                                       ^~~
      |                                       max1
a.cc:35:9: error: 'cout' was not declared in this scope
   35 |         cout << b[i] << endl;
      |         ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstring>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:35:25: error: 'endl' was not declared in this scope
   35 |         cout << b[i] << endl;
      |                         ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<cstring>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:37:5: error: 'cout' was not declared in this scope
   37 |     cout << b[k-1] << endl;
      |     ^~~~
a.cc:37:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:37:23: error: 'endl' was not declared in this scope
   37 |     cout << b[k-1] << endl;
      |                       ^~~~
a.cc:37:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
    
int main() {
  int N;
    int a;
  std::vector<std::string> strList;   
    cin >> N;
  string b;
  cin >> b;
  strList.push_back(b);
    a = strList[0].size();
    for(int i = 1;i<N;i++){
      string c;
      cin >> c;
      if(a == c.size()){
        strList.push_back(c);
      }else if(a < c.size()){
        strList.clear();
        strList.push_back(c);
          a = c.size();
      }
    }
  std::sort(strList.begin(), strList.end());
      int array_size = sizeof(strList) / sizeof(strList[0]);
    for(int j=0;j < arraysize;j++){
      cout << strList[i] << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: 'arraysize' was not declared in this scope; did you mean 'array_size'?
   29 |     for(int j=0;j < arraysize;j++){
      |                     ^~~~~~~~~
      |                     array_size
a.cc:30:23: error: 'i' was not declared in this scope
   30 |       cout << strList[i] << endl;
      |                       ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
    
int main() {
  int N;
    int a;
  std::vector<std::string> strList;   
    cin >> N;
  string b;
  cin >> b;
  strList.push_back(b);
    a = strList[0].size();
    for(int i = 1;i<N;i++){
      string c;
      cin >> c;
      if(a == c.size()){
        strList.push_back(c);
      }else if(a < c.size()){
        strList.clear();
        strList.push_back(c);
          a = c.size();
      }
    }
  std::sort(strList.begin(), strList.end());
      int array_size = sizeof(strList) / sizeof(strList[0])
    for(int j=0;j < arraysize;j++){
      cout << strList[i] << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: expected ',' or ';' before 'for'
   29 |     for(int j=0;j < arraysize;j++){
      |     ^~~
a.cc:29:17: error: 'j' was not declared in this scope
   29 |     for(int j=0;j < arraysize;j++){
      |                 ^
a.cc:29:21: error: 'arraysize' was not declared in this scope; did you mean 'array_size'?
   29 |     for(int j=0;j < arraysize;j++){
      |                     ^~~~~~~~~
      |                     array_size
Language: C++

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

void c_Poll(const std::vector<std::string>& S_list)
{
    std::map<std::string, int> counter;
    int max = 0;
    for (const auto& s : S_list)
    {
        if (counter.count(s) == 0)
            counter[s] = 1;
        else
            ++counter[s];

        if (max < counter[s])
            max = counter[s];
    }

    std::vector<std::string> out;
    for (const auto& c : counter)
    {
        if (c.second == max)
            out.push_back(c.first);
    }

    std::sort(out.begin(), out.end());

    for (const auto& s : out)
        std::cout << s << "\n";
}


int main(int, char* [])
{
    int N;
    std::cin >> N;

    std::vector<std::string> S_list(N);
    for (int i = 0; i < N; ++i)
        std::cin >> S_list[i];

    c_Poll(S_list);

    return 0;
}

Compiler output:
a.cc: In function 'void c_Poll(const std::vector<std::__cxx11::basic_string<char> >&)':
a.cc:28:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   28 |     std::sort(out.begin(), out.end());
      |          ^~~~
      |          qsort
Language: C

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

struct NO;
typedef struct NO NODE;
struct NO
{
	char s[100];
	NODE* next;
};

typedef struct ShuZU
{
	char a[100];
	int count;
	int flag ;
}Shuzu;




int main()
{
	Shuzu a[100];
	NODE* p=NULL,*r=NULL,*t=NULL;
	int n,i,j;
	a[0].flag = 0;
	scanf_s("%d", &n);
	for (i = 0; i < n; i++)
	{
		if (NULL==p)
		{
			p = (NODE*)malloc(sizeof(NODE));
			scanf("%s", p->s);
			p->next = NULL;
			r = p;
		}
		else
		{
			t = (NODE*)malloc(sizeof(NODE));
			scanf("%s", t->s);
			r->next = t;
			t->next = NULL;
			r = t;
		}
	}
	while (p)
	{
		j = 0;
		while (a[j].flag != 0)
		{
			if (strcmp(p->s, a[j].a) == 0)
				a[j].count++;
		}
		if (a[j].flag == 0)
		{
			printf("%p%p", a[j].a, p->s);
			strcpy(a[j].a,p->s);
			a[j].count = 1;
			a[j + 1].flag = 0;
		}
		p = p->next;
		j++;
	}
}

Compiler output:
main.c: In function 'main':
main.c:29:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   29 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

n=int (input())
s = [input() for i in range(n)]


from collections import Counter 


def most_frequent(s): 

    occurence_count = Counter(s) 

    return occurence_count.most_common(1)[0][0] 

 

print(sorted(most_frequent(s)) )

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int (input())
      | ^
Language: C++

#include<cstdio>
#include<iostream>
#include<cmath>
#include<string.h>
#include<algorithm>
#include<set>
#include<cstring>
using namespace std;

char s[200005][12];
int num[200005];

int main()
{
	scanf("%d", &n);
	int n, max = 1, cnt = 0;
	char str[12];
	bool b=true;
	while(n--){
		scanf("%s", str);
		b=true;
		for(int i=0; i<cnt; i++){
			if(strcmp(s[i],str)==0){
				num[i]++;
				if(num[i]>max)	max = num[i];
				b=false;
				break;
			}
		}
		if(b){
			strcpy(s[cnt],str);
			num[cnt++] = 1;
		}
	}
	sort(s);
	for(int i=0; i<cnt; i++){
		if(num[i]==max){
			printf("%s\n", s[i]);
		}
	}
	return 0;	
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 |         scanf("%d", &n);
      |                      ^
      |                      yn
a.cc:35:13: error: no matching function for call to 'sort(char [200005][12])'
   35 |         sort(s);
      |         ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main()
{
  int N;
  cin >> N;
  
  vector<string> S(N);
  for (int i=0; i<N; i++){
    cin >> S[i];
  }
  
  sort(S.begin(),S.end());
  
  vector<int> track;
  
  for (int i=0; i<N-1; i++){
    if (S[i] != S[i+1]){
      track.push_back(i);
    }
    if (S[N-2] == S[N-1]){
      track.push_back(N-1);
    }
  }
  
  vector<int> deff(track.size());
  
  for (int i=0; i<track.size();i++){
    if (i==0){
      deff[i] = track[i]+1;
    }
    if(i>0){
      deff[i]=track[i]-track[i-1];
    }
  }
  
  vector<int> deff_2(track.size());
  deff_2 = deff;
  
  sort(deff.begin(),deff.end());
  reverse(deff.begin(),deff.end());
  int ma;
  ma = deff[0];
  int dummy=0;
  for (int i=0; i<track.size();i++){
    dummy+=deff_2[i];
    if (ma == deff_2[i]){
      cout << S[dummy] << endl;
    }
  }
}
      
  

  

  
  
  return 0;
}

Compiler output:
a.cc:62:3: error: expected unqualified-id before 'return'
   62 |   return 0;
      |   ^~~~~~
a.cc:63:1: error: expected declaration before '}' token
   63 | }
      | ^
Language: C++

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

int main() {

int n;
std::cin >> n;
//char a[n];
std::string a[n];
int b[n];
for(int i=0; i<n; i++) std::cin >> a[i];

for(int i=0; i<n; i++){
    b[i]=0;
    for(int t=0; t<n; t++){
      if(a[i]==a[t]) b[i]=b[i]+1;
    }
   // cout<<b[i]<<endl;
}

int temp=0;
for(int i=0; i<n; i++){
　if(b[i]>temp) temp =b[i];
}

std::string c[n];
int m=0;
for(int i=0; i<n; i++){
    if(temp==b[i]){
     c[m]=a[i];
     m++;
    }
}

string tmp;
  for (int i=0; i<m; i++) {
    for (int j=i+1; j<m; j++) {
      if (c[i] > c[j]) {
        tmp =  c[i];
        c[i] = c[j];
        c[j] = tmp;
      }
    }
  }

for (int i=0; i<m; i++){
    if(c[i-1]==c[i]){
 cout << c[i] <<endl;
    }
}




}


Compiler output:
a.cc:25:1: error: extended character 　 is not valid in an identifier
   25 | 　if(b[i]>temp) temp =b[i];
      | ^
a.cc: In function 'int main()':
a.cc:25:1: error: '\U00003000if' was not declared in this scope
   25 | 　if(b[i]>temp) temp =b[i];
      | ^~~~
Language: C

#include <stdio.h>

int main(void){
 int N,i,count,a,SUM[255];
  char S[255],tmp[0];
  
  scanf("%d",&N);
  
  for(i=0;i<N;i++){
    scanf("%s",&S[i]);
  }
  for(i=0;i<256;i++){
   SUM[i]=0; 
  }
  
  for(i=0;i<N;i++){
   for(a=1;a<N-(a+i);a++) {
     S[i]==S[a];
     SUM[i]++;
   }
  }
  
  for(i=0;i<N-1;i++){
   if(S[i]>S[i+1]){
     tmp[0]=S[i];
     S[i]=S[i+1];
     S[i+1]=tmp[0];
  }
  
  for(i=0;i<N;i++){
  printf("%s",S[i]);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:34:1: error: expected declaration or statement at end of input
   34 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define rep(i,n) for (ll i=0;i<(n);i++)
typedef long long ll;
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	ll n;
	cin>>n;
	map<string,ll> m;
	priority_queue<pair<ll,string> > q;
	rep(i,n)
	{
		string s;
		cin>>s;
		map<string,ll>::iterator iter;
		iter=m.find(s);
		if (iter!=m.end()) iter->second++;
		else m.insert(pair<string,ll>(s,1));
	}
	map<string,ll>::iterator iter;
	for (iter=m.begin();iter!=m.end();iter++)
	{
		string ss;
		ss=iter->first;
		ss[0]='z'-ss[0];
		q.push(make_pair(iter->second,ss));
		m.erase(iter);
	}
	ll prove=q.top().first;
	while (q.size()!=0)
	{
		if (q.top.first()==prove)
		{
			string sss=q.top().second;
			sss[0]='z'-sss[0];
			cout<<sss<<endl;
			q.pop();
		}
		else
		{
			break;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:23: error: invalid use of member function 'std::priority_queue<_Tp, _Sequence, _Compare>::const_reference std::priority_queue<_Tp, _Sequence, _Compare>::top() const [with _Tp = std::pair<long long int, std::__cxx11::basic_string<char> >; _Sequence = std::vector<std::pair<long long int, std::__cxx11::basic_string<char> >, std::allocator<std::pair<long long int, std::__cxx11::basic_string<char> > > >; _Compare = std::less<std::pair<long long int, std::__cxx11::basic_string<char> > >; const_reference = const std::pair<long long int, std::__cxx11::basic_string<char> >&]' (did you forget the '()' ?)
   35 |                 if (q.top.first()==prove)
      |                     ~~^~~
      |                          ()
a.cc:35:27: error: expected ')' before 'first'
   35 |                 if (q.top.first()==prove)
      |                    ~      ^~~~~
      |                           )
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct node{
	string nam;
	int num;
}a[2*100000+5];
int n;
int bhash[2*100000+5];
int hash(string s)
{
	int tot=0;
	for(int i=0;i<s.size();i++)
	{
		tot+=(s[i]-'a');
	}
	return tot;
}
int search(string x)
{
	
	for(int i=1;i<=n;i++)
	{
		if(hash(x) != bhash[i])
			continue;
		if(a[i].nam==x)
		{
			return i;
		}
	}
	return 0;
}
bool cmp(struct node a,struct node b)
{
	if(a.num!=b.num)
	{
		return a.num>b.num;
	}
	else
	{
		return a.nam<b.nam;
	}
}
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		a[i].nam="",a[i].num=0;
	}
	int k=1;
	for(int i=1;i<=n;i++)
	{
		string s;
		cin>>s;
		bhash[i]=hash(s);
		if(!search(s))
		{
			a[k].nam=s,a[k].num++;
			k++;
		}
		else
		{
			a[search(s)].num++;
		}
	}
	sort(a+1,a+n+1,cmp);
	int i=1;
	while(a[i].num==a[1].num&&i<=n)
	{
		i++; 
	}
	i--;
	for(int j=1;j<=i;j++)
	{
		cout<<a[j].nam<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int search(std::string)':
a.cc:23:20: error: reference to 'hash' is ambiguous
   23 |                 if(hash(x) != bhash[i])
      |                    ^~~~
In file included from /usr/include/c++/14/string_view:50,
                 from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:9:5: note:                 'int hash(std::string)'
    9 | int hash(string s)
      |     ^~~~
a.cc: In function 'int main()':
a.cc:55:26: error: reference to 'hash' is ambiguous
   55 |                 bhash[i]=hash(s);
      |                          ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:9:5: note:                 'int hash(std::string)'
    9 | int hash(string s)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int isArraySame(int *ary , int last_index) {
	int count , n_count , same;
	for (count = 0 ; count < last_index - 1; count++) {
		same = *(ary + count);
		for (n_count = count + 1 ; n_count < last_index ; n_count++) {
			if (*(ary + n_count) == same) return 1;
		}
	}
	return 0;
}

int main() {
  int answer = isArraySame;
  int N;
  int j;
  cin >> N;
  
  vector<string> A = {};
 
  // N要素の配列
  vector<string> S(N);
 
  // 入力処理
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  
  for (int i = 0; i < N; i++) {
    if (S.at(i).size() >= j){
      j = S.size();
    }
  }
  
  for (int i = 0; i < N; i++) {
    if (S.at(i).size() == j){
      if(isArraySame == 0){
      A.push_back(S.at(i));
      }
    }
  }
  
  for (int i = 0; i < A.size(); i++) {
    cout << A.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: invalid conversion from 'int (*)(int*, int)' to 'int' [-fpermissive]
   16 |   int answer = isArraySame;
      |                ^~~~~~~~~~~
      |                |
      |                int (*)(int*, int)
Language: C++

#include <string>
#include <stdio.h>
#include <vector>
#include <algorithm>


using namespace std;



int main() {
    int N;
    cin >> N;
    vector<string> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a.at(i);
    }

    vector<int> b(N); //登場回数を比較する変数
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if (a.at(i) == a.at(j)) {
                b.at(i)++;
            }
        }
    }

    int c = 0; //登場した最大の回数を入れる変数
    c = b.at(0);
    for (int i = 0; i < N - 1; i++) {
        if (b.at(i) < b.at(i + 1)) {
            c = b.at(i + 1);
        }
    }

    int d = 0; //最も登場した文字列の添え字を格納する
    for (int i = 0; i < N; i++) {
        if (c == b.at(i)) {
            d++;
        }
    }

    vector<string> e(d);
    for (int i = 0; i < N; i++) {
        if (c == b.at(i)) {
            e.at(i) = a.at(i);
        }
    }
    sort(e.begin(), e.end());

    for (int i = 0; i < d; i++) {
        cout << e.at(i) << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope
   13 |     cin >> N;
      |     ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | 
a.cc:52:9: error: 'cout' was not declared in this scope
   52 |         cout << e.at(i) << endl;
      |         ^~~~
a.cc:52:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:52:28: error: 'endl' was not declared in this scope
   52 |         cout << e.at(i) << endl;
      |                            ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <algorithm>
  +++ |+#include <ostream>
    5 |
Language: C

#include <stdio.h>

int main(void){
 int N,i,count,a,SUM[256];
  char S[256],tmp;
  
  scanf("%d",&N);
  
  for(i=0;i<N;i++){
    scanf("%s",&S[i]);
  }
  for(i=0;i<256;i++){
   SUM[i]=0; 
  }
  
  for(i=0;i<N;i++){
   for(a=1;a<N-(a+i);a++) {
     S[i]==S[a];
     SUM[i]++;
   }
  }
  
  for(i=0;i<N-1;i++){
   if(S[i]>S[i+1]){
     tmp=S[i];
     S[i]=S[i+1];
     S[i+1]=tmp;
  }
  
  for(i=0;i<N;i++){
  printf("%s",S[i]);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:34:1: error: expected declaration or statement at end of input
   34 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct node{
	string nam;
	int num;
}a[2*100000+5];
int n;
int bhash[2*100000+5];
int hash(string s)
{
	int tot=0;
	for(int i=0;i<s.size();i++)
	{
		tot+=(s[i]-'a');
	}
	return tot;
}
int search(string x)
{
	
	for(int i=1;i<=n;i++)
	{
		if(hash(x) != bhash[i])
			continue;
		if(a[i].nam==x)
		{
			return i;
		}
	}
	return 0;
}
bool cmp(struct node a,struct node b)
{
	if(a.num!=b.num)
	{
		return a.num>b.num;
	}
	else
	{
		return a.nam<b.nam;
	}
}
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		a[i].nam="",a[i].num=0;
	}
	int k=1;
	for(int i=1;i<=n;i++)
	{
		string s;
		cin>>s;
		bhash[i]=hash(s);
		if(!search(s))
		{
			a[k].nam=s,a[k].num++;
			k++;
		}
		else
		{
			a[search(s)].num++;
		}
	}
	sort(a+1,a+n+1,cmp);
	int i=1;
	while(a[i].num==a[1].num&&i<=n)
	{
		i++;
	}
	i--;
	for(int j=1;j<=i;j++)
	{
		cout<<a[j].nam<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int search(std::string)':
a.cc:23:20: error: reference to 'hash' is ambiguous
   23 |                 if(hash(x) != bhash[i])
      |                    ^~~~
In file included from /usr/include/c++/14/string_view:50,
                 from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:9:5: note:                 'int hash(std::string)'
    9 | int hash(string s)
      |     ^~~~
a.cc: In function 'int main()':
a.cc:55:26: error: reference to 'hash' is ambiguous
   55 |                 bhash[i]=hash(s);
      |                          ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:9:5: note:                 'int hash(std::string)'
    9 | int hash(string s)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int isArraySame(int *ary , int last_index) {
	int count , n_count , same;
	for (count = 0 ; count < last_index - 1; count++) {
		same = *(ary + count);
		for (n_count = count + 1 ; n_count < last_index ; n_count++) {
			if (*(ary + n_count) == same) return 1;
		}
	}
	return 0;
}

int main() {
  int N;
  int j;
  cin >> N;
  
  vector<string> A = {};
 
  // N要素の配列
  vector<string> S(N);
 
  // 入力処理
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  
  for (int i = 0; i < N; i++) {
    if (S.at(i).size() >= j){
      j = S.size();
    }
  }
  
  for (int i = 0; i < N; i++) {
    if (S.at(i).size() == j){
      int answer = isArraySame;
      if(isArraySame == 0){
      A.push_back(S.at(i));
      }
    }
  }
  
  for (int i = 0; i < A.size(); i++) {
    cout << A.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:20: error: invalid conversion from 'int (*)(int*, int)' to 'int' [-fpermissive]
   38 |       int answer = isArraySame;
      |                    ^~~~~~~~~~~
      |                    |
      |                    int (*)(int*, int)
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int isArraySame(int *ary , int last_index) {
	int count , n_count , same;
	for (count = 0 ; count < last_index - 1; count++) {
		same = *(ary + count);
		for (n_count = count + 1 ; n_count < last_index ; n_count++) {
			if (*(ary + n_count) == same) return 1;
		}
	}
	return 0;
}

int main() {
  int N;
  int j;
  cin >> N;
  
  vector<string> A = {};
 
  // N要素の配列
  vector<string> S(N);
 
  // 入力処理
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  
  for (int i = 0; i < N; i++) {
    if (S.at(i).size() >= j){
      j = S.size();
    }
  }
  
  for (int i = 0; i < N; i++) {
    if (S.at(i).size() == j){
      int answer = isArraySame
      if(isArraySame == 0){
      A.push_back(S.at(i));
      }
    }
  }
  
  for (int i = 0; i < A.size(); i++) {
    cout << A.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:20: error: invalid conversion from 'int (*)(int*, int)' to 'int' [-fpermissive]
   38 |       int answer = isArraySame
      |                    ^~~~~~~~~~~
      |                    |
      |                    int (*)(int*, int)
a.cc:39:7: error: expected ',' or ';' before 'if'
   39 |       if(isArraySame == 0){
      |       ^~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
    
int main() {
  int N;
    int a;
  std::vector<std::string> strList;   
    cin >> N;
  string b;
  cin >> b;
  strList.push_back(b);
    a = strList[0].size();
    for(int i = 1;i<N;i++){
      string c;
      cin >> c;
      if(a == c.size()){
        strList.push_back(c);
      }else if(a < c.size()){
        strList.Clear();
        strList.push_back(c);
          a = c.size()
      }
    }
  std::sort(strList.begin(), strList.end());
      int array_size = GET_ARRAY_SIZE(strList);
    for(int j=0;j < arraysize;i++){
      cout << strList[i] << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'Clear'; did you mean 'clear'?
   22 |         strList.Clear();
      |                 ^~~~~
      |                 clear
a.cc:24:23: error: expected ';' before '}' token
   24 |           a = c.size()
      |                       ^
      |                       ;
   25 |       }
      |       ~                
a.cc:28:24: error: 'GET_ARRAY_SIZE' was not declared in this scope
   28 |       int array_size = GET_ARRAY_SIZE(strList);
      |                        ^~~~~~~~~~~~~~
a.cc:29:21: error: 'arraysize' was not declared in this scope; did you mean 'array_size'?
   29 |     for(int j=0;j < arraysize;i++){
      |                     ^~~~~~~~~
      |                     array_size
a.cc:29:31: error: 'i' was not declared in this scope
   29 |     for(int j=0;j < arraysize;i++){
      |                               ^
Language: C++

N = int(input())
A = {}
for i in range(N):
  s = str(input())
  if s in A:
    A[s] += 1
  else:
    A[s] = 1

max_val = max(A.values())
keys = [key for key in A if A[key] == max_val]
keys.sort()
for s in keys:
  print(s)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for i in range(N):
      | ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;
    
int main() {
  int N;
    int a;
  std::vector<std::string> strList;   
    cin >> N;
  string b;
  cin >> b;
  strList.push_back(b)
    a = strList[0].size()
    for(int i = 1;i<N;i++){
      string c;
      cin >> c;
      if(a == c.size()){
        strList.push_back(c)
      }else if(a < c.size()){
        strList.Clear();
        strList.push_back(c)
          a = c.size()
      }
    }
  sort(strList.begin(), strList.end());
      int array_size = GET_ARRAY_SIZE(strList);
    for(int j=0;j < arraysize;i++){
      cout << strList[i] << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before 'a'
   13 |   strList.push_back(b)
      |                       ^
      |                       ;
   14 |     a = strList[0].size()
      |     ~                  
a.cc:15:19: error: 'i' was not declared in this scope
   15 |     for(int i = 1;i<N;i++){
      |                   ^
a.cc:26:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |   sort(strList.begin(), strList.end());
      |   ^~~~
      |   short
a.cc:27:24: error: 'GET_ARRAY_SIZE' was not declared in this scope
   27 |       int array_size = GET_ARRAY_SIZE(strList);
      |                        ^~~~~~~~~~~~~~
a.cc:28:21: error: 'arraysize' was not declared in this scope; did you mean 'array_size'?
   28 |     for(int j=0;j < arraysize;i++){
      |                     ^~~~~~~~~
      |                     array_size
Language: C++

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

int main() {
  int N ;
  cin >> N ;
  vector<string> vec(N);
  string str;
  for(int i;i < N;i++){
    vec.at(i) = str;
      cin >> str ;
    
  }
  sort(vec.begin(),vec.end())
    for(int i;i < N ;i++){
    if(vec.at(i) == vec.at(i + 1)){
     vec.at(i) = "";
    }
      cout << vec.at(i) ;
      if(vec.at(i) != 0)cout << endl;
    }
   
 
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: expected ';' before 'for'
   14 |   sort(vec.begin(),vec.end())
      |                              ^
      |                              ;
   15 |     for(int i;i < N ;i++){
      |     ~~~                       
a.cc:15:15: error: 'i' was not declared in this scope
   15 |     for(int i;i < N ;i++){
      |               ^
Language: C++

#include <bits/stdc++.h>
#include <string>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
const int INF = 1001001001;


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

    vector<string> S(N);
    set<string> SS;

    REP(i,N)
    {
        cin >> S[i];
        SS.insert(S[i]);
    }

    int cot, max_cot = 0;
    queue<string> que;
    for (auto x : SS) {
        cot = 0;
        cot = count_if(S.begin(), S.end(), x);
        max_cot = max(cot, max_cot);
        if(cot == max_cot) {
            que.push(x);
        } else {
            queue<string> empty;
            swap(que, empty);
            que.push(x);
        }
    }

    
    while(!que.empty()) {
        cout << que.front() << endl;
        que.pop();
    }

    return 0;
  
}


Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_pred<_Predicate>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Predicate = std::__cxx11::basic_string<char>]':
/usr/include/c++/14/bits/stl_algobase.h:2163:12:   required from 'typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::__count_if(_InputIterator, _InputIterator, _Predicate) [with _InputIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Predicate = __gnu_cxx::__ops::_Iter_pred<__cxx11::basic_string<char> >; typename iterator_traits< <template-parameter-1-1> >::difference_type = long int]'
 2163 |         if (__pred(__first))
      |             ~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4057:29:   required from 'typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count_if(_IIter, _IIter, _Predicate) [with _IIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Predicate = __cxx11::basic_string<char>; typename iterator_traits< <template-parameter-1-1> >::difference_type = long int]'
 4057 |       return std::__count_if(__first, __last,
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
 4058 |                              __gnu_cxx::__ops::__pred_iter(__pred));
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:29:23:   required from here
   29 |         cot = count_if(S.begin(), S.end(), x);
      |               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:318:30: error: no match for call to '(std::__cxx11::basic_string<char>) (std::__cxx11::basic_string<char>&)'
  318 |         { return bool(_M_pred(*__it)); }
      |                       ~~~~~~~^~~~~~~
Language: C++

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

int main() {
  int N ;
  cin >> N ;
  vector<string> vec(N);
  string str;
  for(int i;i < N;i++){
    vec.at(i) = str
      cin >> str ;
    
  }
  sort(vec.begin(),vec.end())
    for(int i;i < N ;i++){
    if(vec.at(i) == vec.at(i + 1)){
     vec.at(i) = "";
    }
      cout << vec.at(i) ;
      if(vec.at(i) != 0)cout << endl;
    }
   
 
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected ';' before 'cin'
   10 |     vec.at(i) = str
      |                    ^
      |                    ;
   11 |       cin >> str ;
      |       ~~~           
a.cc:14:30: error: expected ';' before 'for'
   14 |   sort(vec.begin(),vec.end())
      |                              ^
      |                              ;
   15 |     for(int i;i < N ;i++){
      |     ~~~                       
a.cc:15:15: error: 'i' was not declared in this scope
   15 |     for(int i;i < N ;i++){
      |               ^
Language: C

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

int main() {
	int n;
	string *s;
	string sCnt;	// 数えている文字
	map<string, int> m;
	int max = 1;
	
	cin >> n;
	
	s = new string[n];
	
	for(int i=0; i<n; i++){
		cin >> s[i];
	}
	sort(s, s+n);
	
	for(int i=0; i<n; i++){
		if (m.count(s[i]) == 0) {
			m.insert(map<string, int>::value_type(s[i], 1));
		} else{
			m[s[i]] = m[s[i]]+1;
			if(m[s[i]] > max){
				max = m[s[i]];
			}
		}
	}
	
	auto begin = m.begin(), end = m.end();
	for(auto iter = begin; iter != end; iter++){
		if(iter->second == max){
			cout << iter->first << "\n";
		}
	}
	
	delete[] s;
	
	return 0;
}

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

#include <iostream>
#include <string>
using namespace std;
    
int main() {
  int N;
    int a;
  std::vector<std::string> strList;   
    cin >> N;
  string b;
  cin >> b;
  strList.push_back(b)
    a = strList[0].size()
    for(int i = 1;i<N;i++){
      string c;
      cin >> c;
      if(a == c.size()){
        strList.push_back(c)
      }else if(a < c.size()){
        strList.Clear();
        strList.push_back(c)
          a = c.size()
      }
    }
  sort(strList.begin(), strList.end());
      int array_size = GET_ARRAY_SIZE(strList);
    for(int j=0;j < arraysize;i++){
      cout << strList[i] << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'vector' is not a member of 'std'
    8 |   std::vector<std::string> strList;
      |        ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:8:26: error: expected primary-expression before '>' token
    8 |   std::vector<std::string> strList;
      |                          ^
a.cc:8:28: error: 'strList' was not declared in this scope
    8 |   std::vector<std::string> strList;
      |                            ^~~~~~~
a.cc:14:19: error: 'i' was not declared in this scope
   14 |     for(int i = 1;i<N;i++){
      |                   ^
a.cc:25:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 |   sort(strList.begin(), strList.end());
      |   ^~~~
      |   short
a.cc:26:24: error: 'GET_ARRAY_SIZE' was not declared in this scope
   26 |       int array_size = GET_ARRAY_SIZE(strList);
      |                        ^~~~~~~~~~~~~~
a.cc:27:21: error: 'arraysize' was not declared in this scope; did you mean 'array_size'?
   27 |     for(int j=0;j < arraysize;i++){
      |                     ^~~~~~~~~
      |                     array_size
Language: C++

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

int main() {
  int N ;
  cin >> N ;
  vector<string> vec(N);
  string str;
  for(int i;i < N;i++){
    vec.at(i) = str
      cin >> str ;
    
  }
  sort(vec.bigin(),vec.end())
    for(int i;i < N ;i++){
    if(vec.at(i) == vec.at(i + 1)){
     vec.at(i) = "";
    }
      cout << vec.at(i) ;
      if(vec.at(i) != 0)cout << endl;
    }
   
 
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected ';' before 'cin'
   10 |     vec.at(i) = str
      |                    ^
      |                    ;
   11 |       cin >> str ;
      |       ~~~           
a.cc:14:12: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'bigin'; did you mean 'begin'?
   14 |   sort(vec.bigin(),vec.end())
      |            ^~~~~
      |            begin
a.cc:15:15: error: 'i' was not declared in this scope
   15 |     for(int i;i < N ;i++){
      |               ^
Language: C++

#include<cstdio>
#include <string.h>
#include <bits/stdc++.h>
int  a[200001]={0};
using namespace std;
struct Data
{
      char data[11];
 }s[200001];
 bool cmp(const Data &elem1, const Data &elem2)
{   if (strcmp(elem1.data, elem2.data) < 0)
    return true;
    return false;
}
int main()
{
    int n,i,j;
    scanf("%d",&n);
    getchar();
    for(i=0;i<n;i++)
        gets(s[i].data);
    sort(s,s+n,cmp);
    for(i=0;i<n;i++)
    {
        for(j=i;j<n;j++)
        {
            if(strcmp(s[i].data,s[j].data)==0)
            {
                a[i]++;
            }
        }
    }
    int max1=a[0];
    for(i=1;i<n;i++)
    {
        if(a[i]>max1)max1=a[i];
    }
    for(i=0;i<n;i++)
    {
        if(a[i]==max1)printf("%s\n",s[i].data);
    }
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   21 |         gets(s[i].data);
      |         ^~~~
      |         getw