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

#include<cstdio>
#include <cstring>
#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
Language: C++

#include<cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
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:22:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |         gets(s[i].data);
      |         ^~~~
      |         getw
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string N[200005],NN[200005]={""};
  int m[200005]={0};
  int n,w=0,o=0;
  cin>>n;
  for(int i=0;i<n;i++)
    cin>>N[i];
  for(int i=0;i<n;i++){
    for(int j=0;j<i;j++)
      if(N[i]==N[j])
        w++;
    for(int j=i+1;j<n;j++)
      if(N[i]==N[j])
        w++;
    m[i]+=w+1;
    i+=w;
    NN[i]=N[i];
    o++;
  }
  int f=0;
  for(int i=0;i<n;i++)
    f=max(f,m[i]);
  string p[200005]={""};
  for(int i=0;i<n;i++)
    if(m[i]==f){
      p[o]=NN[i];
      o++;
    }
  for(int i=0;i<n;i++){
    string d="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
    for(int j=0;j<n;j++){
      if(p[j]=="");
      else
        d=min(d,p[j]);
    }
    for(int j=0;j<n;j++)
      if(d==p[j])
        p[j]="";
    cout<<d<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: expected ',' or ';' before 'for'
   33 |     for(int j=0;j<n;j++){
      |     ^~~
a.cc:33:17: error: 'j' was not declared in this scope
   33 |     for(int j=0;j<n;j++){
      |                 ^
Language: C++

#include<cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
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:22:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |         gets(s[i].data);
      |         ^~~~
      |         getw
Language: C++

#include<cstdio>
#include <cstring>
#include <algorithm>
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
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n;
    cin >> n;
    int a[200005];
    vector<string> s;
    for(int i = 0; i < n; ++i){
        string s1;
        cin >> s1;
        s.push_back(s1);
    }
    sort(s.begin(), s.end());
    //cout << endl;
    //for(int i = 0; i < n; ++i) cout << s[i] <<  endl;

    int sum = 1;
    int flag = 0;
    int i = 1;
    for(i; i < n; ++i){
        if(s[i] == s[i - 1]){
            sum++;
        }
        else{
            a[flag] = sum;
            flag = i;
            sum = 1;
        }
    }
    a[flag] = sum;
    int max = - 1;
    for(int j = 0; j < n; j++){
        if(a[j] > max) max = a[j];
    }
    for(int j = 0; j < n; j++){
        if(a[j] == max){
            cout << s[j] << endl;
        }
    }

    return 0;
}

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

import java.util.*;
public class Main {
    public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
      	String p[] = new String[n];
      	int pcnt[] = new int[n];
      	int cnt = 0;
      	for(int i=0;i<p.length;i++){
          p[i] = sc.next();
          for(int t=0;t<i;t++){
            if( p[i]==p[t] ){
              pcnt[t]++;
            }
              if( pcnt[t]>cnt ){
                cnt = pcnt[t];
              }
              t=i;
            }
          }
        }
      int num = 0;
      for(int i=0;i<pcnt.length;i++){
        if(pcnt[i]==cnt){
          num++;
        }
      }
      int number[] = new int[num];
      int count = 0;
      for(int i=0;i<pcnt.length;i++){
        if(pcnt[i]==cnt){
          number[count] = i;
          count++;
        }
      }
      for(int i=0;i<number.length;i++){
        for(int j=i+1;j<number.length;j++){
          if(p[number[i]].compareTo(p[number[j]]) > 0 ){
            String tmp = p[number[i]];
            p[number[i]] = p[number[j]];
            p[number[j]] = tmp;
          }
        }
      }
      for(int i=0;i<number.length;i++){
        System.out.println(p[number[i]]);
      }
      
      
    }
}

Compiler output:
Main.java:23: error: illegal start of type
      for(int i=0;i<pcnt.length;i++){
      ^
Main.java:23: error: > or ',' expected
      for(int i=0;i<pcnt.length;i++){
                               ^
Main.java:23: error: <identifier> expected
      for(int i=0;i<pcnt.length;i++){
                                 ^
Main.java:30: error: illegal start of type
      for(int i=0;i<pcnt.length;i++){
      ^
Main.java:30: error: > or ',' expected
      for(int i=0;i<pcnt.length;i++){
                               ^
Main.java:30: error: <identifier> expected
      for(int i=0;i<pcnt.length;i++){
                                 ^
Main.java:36: error: illegal start of type
      for(int i=0;i<number.length;i++){
      ^
Main.java:36: error: > or ',' expected
      for(int i=0;i<number.length;i++){
                                 ^
Main.java:36: error: <identifier> expected
      for(int i=0;i<number.length;i++){
                                   ^
Main.java:45: error: illegal start of type
      for(int i=0;i<number.length;i++){
      ^
Main.java:45: error: > or ',' expected
      for(int i=0;i<number.length;i++){
                                 ^
Main.java:45: error: <identifier> expected
      for(int i=0;i<number.length;i++){
                                   ^
Main.java:51: error: class, interface, enum, or record expected
}
^
13 errors
Language: C

#include <stdio.h>
#include <string.h>
void swap_str(char s1[], char s2[]){
char temp[128];
int i;

for (i = 0; (temp[i] = s1[i]) != '\0'; i++){　

}

for (i = 0; (s1[i] = s2[i]) != '\0'; i++){

}

for (i = 0; (s2[i] = temp[i]) != '\0'; i++){

}
}

int main(void){
    char s[2*100000][10];
    int n;
    int co[2*100000] = {0};
    scanf("%d",&n);
    int i,j,temp;
    int max = 1;

    for(i=0;i<n;i++){
        scanf("%s",s[i]);
        for(j=0;s[j][0];j++){
            if(strcmp(s[j],s[i]) == 0){
                co[i]++;
                if(co[i]>max)
                    max = co[i];
            }else if(strcmp(s[j],s[i])<0){
                swap_str(s[i],s[j]);
                temp = co[i];
                
                co[i] = co[j];
                co[j] = temp;
            }
        }
    }

    for(j=0;s[j][0];j++){
        if(co[j] == max)
            puts(s[j]);
    }
   
    return 0;
}


Compiler output:
main.c: In function 'swap_str':
main.c:7:45: error: stray '\343' in program
    7 | for (i = 0; (temp[i] = s1[i]) != '\0'; i++){<U+3000>
      |                                             ^~~~~~~~
Language: C++

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

int compare(const void *a, const void *b)
{
	return strcmp(a, b);
}
char arr[200000][11], str[200000][11], a[11];
int num[200000];
int main()
{
	int n, i, cnt=1, j=0, max=0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%s", arr[i]);
	}
	qsort((void *) arr, n, sizeof(arr[0]), compare);
	strcpy(a, arr[0]);
	strcpy(str[0], a);
	for (i = 1; i <= n; i++){
		if(strcmp(a,arr[i])==0){
			cnt++;
			continue;
		}
		num[j]=cnt;
		j++;
		strcpy(a, arr[i]);
		strcpy(str[j], a);
		cnt=1;
	}	
	for(i=0; i<=j; i++){
		if(num[i]>max)
			max=num[i];
	}
	for(i=0; i<j; i++){
		if(max==num[i])
			printf("%s\n", str[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int compare(const void*, const void*)':
a.cc:7:23: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
    7 |         return strcmp(a, b);
      |                       ^
      |                       |
      |                       const void*
In file included from a.cc:3:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:7:26: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
    7 |         return strcmp(a, b);
      |                          ^
      |                          |
      |                          const void*
/usr/include/string.h:156:50: note:   initializing argument 2 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
      	String p[] = new String[n];
      	int pcnt[] = new int[n];
      	int cnt = 0;
      	for(int i=0;i<p.length;i++){
          p[i] = sc.next();
          for(int t=0;t<i;t++){
            if( p[i]==p[t] ){
              pcnt[t]++;
              if( pcnt[t]>cnt ){
                cnt = pcnt[t];
              }
              t=i;
            }
          }
        }
      int num = 0;
      for(int i=0;i<pcnt.length;i++){
        if(pcnt[i]==cnt){
          num++
        }
      }
      int number[] = new int[num];
      int count = 0;
      for(int i=0;i<pcnt.length;i++){
        if(pcnt[i]==cnt){
          number[count] = i;
          count++;
        }
      }
      for(int i=0;i<number.length;i++){
        for(int j=i+1;j<number.length;j++){
          if(p[number[i]].compareTo(p[number[j]]) > 0 ){
            String tmp = p[number[i]];
            p[number[i]] = p[number[j]];
            p[number[j]] = tmp;
          }
        }
      }
      for(int i=0;i<number.length;i++){
        System.out.println(p[number[i]]);
      }
      
      
    }
}

Compiler output:
Main.java:24: error: ';' expected
          num++
               ^
1 error
Language: C++

include <bits/stdc++.h>
using namespace std;
static const int SIZE = 500000;

int main(){
  int n;
  cin>>n;
  vector<pair<int,string>> data(SIZE);
  int kake[26];
  int cnt =1;

  for(int i=0; i<26; i++){
    kake[i] = cnt;
    cnt += 2;
  }
  
  int ans = 0;

  for (int i=SIZE-1; i>=0; i--){
    data[i].first = 0;
  }

  for(int i=0; i<n; i++){
    string s;
    cin>>s;
    int v =0 ;
    for(int j=0; j<s.size(); j++){
      int ind;
      ind = (s[j]-'a');
      v +=  kake[ind]*kake[ind]*(j)+ind;
    }
    
    data[v].first++;
    ans = max(ans,data[v].first);
    data[v].second = s;
  }

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

  vector<string> res;

  for(int i=SIZE-1; i>=0; i--){
    if(ans != data[i].first) break;
    res.push_back(data[i].second);
  }

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

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

  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>n;
      |   ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<pair<int,string>> data(SIZE);
      |   ^~~~~~
a.cc:8:10: error: 'pair' was not declared in this scope
    8 |   vector<pair<int,string>> data(SIZE);
      |          ^~~~
a.cc:8:15: error: expected primary-expression before 'int'
    8 |   vector<pair<int,string>> data(SIZE);
      |               ^~~
a.cc:20:5: error: 'data' was not declared in this scope
   20 |     data[i].first = 0;
      |     ^~~~
a.cc:24:5: error: 'string' was not declared in this scope
   24 |     string s;
      |     ^~~~~~
a.cc:25:10: error: 's' was not declared in this scope
   25 |     cin>>s;
      |          ^
a.cc:33:5: error: 'data' was not declared in this scope
   33 |     data[v].first++;
      |     ^~~~
a.cc:34:11: error: 'max' was not declared in this scope
   34 |     ans = max(ans,data[v].first);
      |           ^~~
a.cc:38:8: error: 'data' was not declared in this scope
   38 |   sort(data.begin(),data.end());
      |        ^~~~
a.cc:38:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   38 |   sort(data.begin(),data.end());
      |   ^~~~
      |   short
a.cc:40:10: error: 'string' was not declared in this scope
   40 |   vector<string> res;
      |          ^~~~~~
a.cc:40:18: error: 'res' was not declared in this scope
   40 |   vector<string> res;
      |                  ^~~
a.cc:50:5: error: 'cout' was not declared in this scope
   50 |     cout<<res[i]<<endl;
      |     ^~~~
a.cc:50:19: error: 'endl' was not declared in this scope
   50 |     cout<<res[i]<<endl;
      |                   ^~~~
Language: C++

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

int main(){
  int n;
  int count[n]
  cin>>n;
  string dec[];
  for(int i=0; i<=n-1; i++){
    cin>>dec[i];
    for(int j=0; j<=n-1; j++){
      if(count[j]>=1){
        if(dec[i]==dec[count[j]]){
          count[j]++;
          goto CUT;
        }
      }
    }
    count[i]++;
    CUT:
  }
  int top;
  int num;
  int tops[n];
  for(int i=0; i<=n-1; i++){
    if(count[i]>top){
      top=count[i];
      for(int j=0; j<=n-1; j++){
        num=0;
        top[j]=0;
      }
    }else if(count[i]==top){
      tops[num]=i;
    }
  }
  string fa[num+1];
  for(int i=0; i<=num+1; i++){
    fa[i]=dec[tops[i]];
  }
  sort(fa.begin(),fa.end());
  for(int i=0; i<=num+1; i++){
    cout<<fa[i];
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'cin'
    8 |   cin>>n;
      |   ^~~
a.cc:9:10: error: array size missing in 'dec'
    9 |   string dec[];
      |          ^~~
a.cc:13:10: error: 'count' was not declared in this scope
   13 |       if(count[j]>=1){
      |          ^~~~~
a.cc:20:5: error: 'count' was not declared in this scope
   20 |     count[i]++;
      |     ^~~~~
a.cc:22:3: warning: label at end of compound statement only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   22 |   }
      |   ^
a.cc:27:8: error: 'count' was not declared in this scope
   27 |     if(count[i]>top){
      |        ^~~~~
a.cc:31:12: error: invalid types 'int[int]' for array subscript
   31 |         top[j]=0;
      |            ^
a.cc:41:11: error: request for member 'begin' in 'fa', which is of non-class type 'std::string [(num + 1)]' {aka 'std::__cxx11::basic_string<char> [(num + 1)]'}
   41 |   sort(fa.begin(),fa.end());
      |           ^~~~~
a.cc:41:22: error: request for member 'end' in 'fa', which is of non-class type 'std::string [(num + 1)]' {aka 'std::__cxx11::basic_string<char> [(num + 1)]'}
   41 |   sort(fa.begin(),fa.end());
      |                      ^~~
a.cc:41:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   41 |   sort(fa.begin(),fa.end());
      |   ^~~~
      |   short
Language: Java

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Scanner;

class Tango {
    Tango(String name,int count) {
        this.name = name;
        this.count = count;
    }
    String name;
    int count;
}
public class Main3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());
        ArrayList<Tango> lists = new ArrayList<>();
        //mapに入れる
        HashMap<String, Tango> map = new HashMap<>();
        for (int i = 0; i < N; i++) {
            String s = sc.nextLine();
            if (map.containsKey(s)) {
                Tango t = (Tango) map.get(s);
                t.count++;
            } else {
                Tango t = new Tango(s, 1);
                map.put(s, t);
                lists.add(t);
            }
        }
        lists.sort(new Comparator<Tango>() {
            public int compare(Tango t1, Tango t2){
                if (t1.count == t2.count) {
                    return t1.name.compareTo(t2.name);
                }
                else {
                    if (t1.count < t2.count)
                        return 1;
                    else
                        return -1;
                }
            }
        });
        int cnt = lists.get(0).count;
        for (Tango t : lists) {
            if (cnt != t.count)
                break;
            System.out.println(t.name);
        }
    }
}

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

import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main2 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for (int i = 0; i < n; i++) {
			String z = s.next();
			if (map.containsKey(z)) {
				int v = map.get(z) + 1;
				max = Math.max(max, v);
				map.put(z, v);
			}else {
				map.put(z, 1);
				max = Math.max(max, 1);
			}
		}
		for(String k : map.keySet()) {
			if (map.get(k) == max) {
				System.out.println(k);
			}
		}
	}
	
	
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<string> a;
  string s;
  for(int i=0;i<n;i++){
    cin>>s;
    a.push_back(s);
  }
  map<string,int>m;
  int max=1;
  for(int i=0;i<a.size();i++){
    if(m.find(a[i])==m.end()){
      m.insert(pair<string,int>(a[i],1));
    }
    else{
      m[a[i]]+=1;
      if(m[a[i]]>max){
        max=m[a[i]];
      }
    }
  }
  for(auto it=m.begin();it!=m.end();it++){
    if(it.second==max){
      cout<<it.first<<endl;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: 'struct std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >' has no member named 'second'
   26 |     if(it.second==max){
      |           ^~~~~~
a.cc:27:16: error: 'struct std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >' has no member named 'first'
   27 |       cout<<it.first<<endl;
      |                ^~~~~
Language: Java

import java.util.*;
import java.util.stream.Collectors;

public class Main13 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        scanner.nextLine();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            list.add(scanner.nextLine());
        }
        Map<String, Long> grouped = list.stream().collect(Collectors.groupingBy(x -> x, Collectors.counting()));
        Map<Long, List<String>> map = grouped.keySet().stream().collect(Collectors.groupingBy(grouped::get));
        long max = map.keySet().stream().mapToLong(m -> m).max().getAsLong();
        map.get(max).forEach(System.out::println);
    }
}

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

#include <bits/stdc++.h>

using namespace std;

int main() {

  

  int n;
  int k;
int max;
  int start,end;
vector<string> s(n-1);
  
  cin >> n;
  for (int i = 0;i<n;i++){
   cin >> s.at(i) ;
    }
  
std::sort(s.begin(), s.end());
  start =0;
  k =0;
  for(int i=1;i<n;i++){
    if (!(s.at(i) == s.at(i-1)){
      end =i-1;
      if (start - end >=max){
        max = start -end;
        k = i-1;
        }
      start =i;
      }
        }
  

cout << s.at(k) << endl;

  

    }


Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: expected ')' before '{' token
   24 |     if (!(s.at(i) == s.at(i-1)){
      |        ~                       ^
      |                                )
a.cc:32:9: error: expected primary-expression before '}' token
   32 |         }
      |         ^
Language: C++

#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <boost/foreach.hpp>
using namespace std;

typedef map<string, int> container;
typedef pair<string, int> value_type;

struct second_order {
  bool operator()(const value_type& x, const value_type& y) const {
    if(x.second != y.second){
    	return x.second > y.second;
    }
    else{
      string xs = x.first, ys = y.first;
      return (strcmp(x.first, y.first) < 0);
    }
  }
};

int main() {
  container src;
  int n;
  cin >> n;
  
  for(string x; n--; src[x]++){
    cin >> x;
  }
  
  priority_queue<value_type, vector<value_type>, second_order> que;
  pair<string, int> p;
  BOOST_FOREACH(p, src) {
    que.push(p);
  }
  
  while ( !que.empty() ) {
    value_type item = que.top();
    cout << item.first << endl;
    que.pop();
  }
  
  return 0;
}

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

#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <boost/foreach.hpp>
using namespace std;

typedef map<string, int> container;
typedef pair<string, int> value_type;

struct second_order {
  bool operator()(const value_type& x, const value_type& y) const {
    if(x.second != y.second){
    	return x.second > y.second;
    }
    else{
      char xs[x.first.length()+1] = x.first, ys[y.first.length()+1] = y.first;
      return (strcmp(xs, ys) < 0);
    }
  }
};

int main() {
  container src;
  int n;
  cin >> n;
  
  for(string x; n--; src[x]++){
    cin >> x;
  }
  
  priority_queue<value_type, vector<value_type>, second_order> que;
  pair<string, int> p;
  BOOST_FOREACH(p, src) {
    que.push(p);
  }
  
  while ( !que.empty() ) {
    value_type item = que.top();
    cout << item.first << endl;
    que.pop();
  }
  
  return 0;
}

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

#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <boost/foreach.hpp>
using namespace std;

typedef map<string, int> container;
typedef pair<string, int> value_type;

struct second_order {
  bool operator()(const value_type& x, const value_type& y) const {
    if(x.second != y.second){
    	return x.second > y.second;
    }
    else{
      char xs[] = x.first, ys[] = y.first;
      return (strcmp(xs, ys) < 0);
    }
  }
};

int main() {
  container src;
  int n;
  cin >> n;
  
  for(string x; n--; src[x]++){
    cin >> x;
  }
  
  priority_queue<value_type, vector<value_type>, second_order> que;
  pair<string, int> p;
  BOOST_FOREACH(p, src) {
    que.push(p);
  }
  
  while ( !que.empty() ) {
    value_type item = que.top();
    cout << item.first << endl;
    que.pop();
  }
  
  return 0;
}

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

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

int main(){
	int N;
	string S[200000];
	int c;
	int max_c;

	cin >> N;
	for(int i=0; i<N; i++){
		cin >> S[i];
	}
	sort(S,S+N);

	c=1; max_c=0;
	for(int i=1; i<N; i++){
		if(S[i]!=S[i-1]){
		  if(max_c<c){ max_c=c; }
		  c=0;
		}
		c++;
	}
	if(max_c<c){ max_c=c; }

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


	
}

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

#include <iostream>
#include <vector>
#include <string>
#include <utility>
int main(){
  int N = 0;
  std::string str;
  std::cin >> N;
  std::vector<std::string> S;
  std::vector<std::pair<std::string,int> > newS;
  std::vector<std::string> ans;

  for(int i =0; i  < N; i++) {
    std::cin >> str;
    S.push_back(str);
    if(newS.empty()){
      newS.push_back(std::make_pair(str, 1));
    }else{
      bool ok = false;
      for(auto & sss : newS){
        if(sss.first == str){
          sss.second++;
          ok = true;
          break;
        }
      }
      if(!ok)
      newS.push_back(std::make_pair(str, 1));
    }//else
  }
  // std::sort(S.begin(), S.end());
  int max = 0;
  for(auto & sss : newS){
    max = std::max(sss.second, max);
  }
  for(auto & sss : newS){
    if(sss.second == max){
      ans.push_back(sss.first);
    }
  }

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

  for(int i = 0; i < ans.size(); i++){
    std::cout << ans[i] << std::endl;
  }




  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   42 |   std::sort(ans.begin(), ans.end());
      |        ^~~~
      |        qsort
Language: C++

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

map <string,int> m;

int main(){
	cin>>N;
  
  	for (int i=0;i<N;i++){
		string str;
      	cin>>str;
      	m[str]++;
    }
  	int mx = 0;
  	for (auto i: m){
		mx = max(mx,i.s);
    }
  
  vector <string> ans;
  for (auto i: m){
    if (i.s == mx){
		ans.push_back(i.f);
    }
  }
  
  sort(ans.begin(),ans.end());
  for (auto i: ans) cout<<i<<'\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'N' was not declared in this scope
    7 |         cin>>N;
      |              ^
a.cc:16:31: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 's'
   16 |                 mx = max(mx,i.s);
      |                               ^
a.cc:21:11: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 's'
   21 |     if (i.s == mx){
      |           ^
a.cc:22:33: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 'f'
   22 |                 ans.push_back(i.f);
      |                                 ^
Language: C++

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

map <string,int> m;
int N;
int main(){
	cin>>N;
  
  	for (int i=0;i<N;i++){
		string str;
      	cin>>str;
      	m[str]++;
    }
  	int mx = 0;
  	for (auto i: m){
		mx = max(mx,i.s);
    }
  
  vector <string> ans;
  for (auto i: m){
    if (i.s == mx){
		ans.push_back(i.f);
    }
  }
  
  sort(ans.begin(),ans.end());
  for (auto i: ans) cout<<i<<' ';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 's'
   16 |                 mx = max(mx,i.s);
      |                               ^
a.cc:21:11: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 's'
   21 |     if (i.s == mx){
      |           ^
a.cc:22:33: error: 'struct std::pair<const std::__cxx11::basic_string<char>, int>' has no member named 'f'
   22 |                 ans.push_back(i.f);
      |                                 ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
int main(){
  int N = 0;
  std::string str;
  std::cin >> N;
  std::vector<std::string> S;
  std::vector<std::pair<std::string,int> > newS;
  std::vector<std::string> ans;

  for(int i =0; i  < N; i++) {
    std::cin >> str;
    S.push_back(str);
    if(newS.empty()){
      newS.push_back(std::make_pair(str, 1));
    }else{
      bool ok = false;
      for(auto & sss : newS){
        if(sss.first == str){
          sss.second++;
          ok = true;
          break;
        }
      }
      if(!ok)
      newS.push_back(std::make_pair(str, 1));
    }//else
  }
  // std::sort(S.begin(), S.end());
  int max = 0;
  for(auto & sss : newS){
    max = std::max(sss.second, max);
  }
  for(auto & sss : newS){
    if(sss.second == max){
      ans.push_back(sss.first);
    }
  }

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

  for(int i = 0; i < ans.size(); i++){
    std::cout << ans[i] << std::endl; 
  }




  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   41 |   std::sort(ans.begin(), ans.end());
      |        ^~~~
      |        qsort
Language: C++

#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <boost/foreach.hpp>
using namespace std;

typedef map<string, int> container;
typedef pair<string, int> value_type;

struct second_order {
  bool operator()(const value_type& x, const value_type& y) const {
    if(x.second != y.second){
    	return x.second > y.second;
    }
    else{
      const char* xs = x.first, ys = y.first;
      return (strcmp(xs, ys) < 0);
    }
  }
};

int main() {
  container src;
  int n;
  cin >> n;
  
  for(string x; n--; src[x]++){
    cin >> x;
  }
  
  priority_queue<value_type, vector<value_type>, second_order> que;
  pair<string, int> p;
  BOOST_FOREACH(p, src) {
    que.push(p);
  }
  
  while ( !que.empty() ) {
    value_type item = que.top();
    cout << item.first << endl;
    que.pop();
  }
  
  return 0;
}

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

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

int n;
char arr[200010][11];
int a[200010];
int c;
int maxx;

int compare(const void *a, const void *b)
{
	return strcmp(a, b);
}

int main(void)
{
	int i;
	
	scanf("%d", &n);

	for(i = 0; i < n; i++)
	{
		scanf("%s", arr[i]);
	}
	
	qsort((void *) arr, n, sizeof(arr[0]), compare);
	
	i = 0;
	
	while(i < n)
	{
		int cnt = 1;
		
		while(strcmp(arr[i], arr[i + cnt]) == 0)
			cnt++;
		
		a[i] = cnt;
		
		i += cnt;
		
		if(maxx < cnt)
			maxx = cnt;
	}
	
	for(i = 0 ; i < n ; i++)
	{
		if(a[i] == maxx)
		{
			printf("%s\n", arr[i]);
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int compare(const void*, const void*)':
a.cc:13:23: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
   13 |         return strcmp(a, b);
      |                       ^
      |                       |
      |                       const void*
In file included from a.cc:3:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:13:26: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
   13 |         return strcmp(a, b);
      |                          ^
      |                          |
      |                          const void*
/usr/include/string.h:156:50: note:   initializing argument 2 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
Language: C++

#include <stdio.h>
#include <math.h>
#define LL long long int
#define N 20005
struct mm
{
    char a[11];
    int count;
} ;
struct mm str[N];
char tt[N][11];
int main()
{
    int n,i,max=0,count,j,sum=0;
    char t[11];
    scanf("%d",&n);
    getchar();
    for(i=0; i<n; i++)
    {
        gets(t);
        for(j=0; j<count; j++)
        {
            if(strcmp(t,str[j].a)==0)
            {
                str[j].count++;
                if(max<str[j].count)
                    max=str[j].count;
                break;
            }
        }
        if(j>=count)
        {
            strcpy(str[count].a,t);
            str[count].count=1;
            if(max<str[count].count)
                max=str[count].count;
            count++;
        }
    }
    for(i=0; i<count; i++)
        if(str[i].count==max)
        {
            strcpy(tt[sum++],str[i].a);

        }
       // printf("\n\n");
    for(i=0; i<sum; i++)
    {
        int k=i;
        for(j=i+1; j<sum; j++)
        {
            if(strcmp(tt[k],tt[j])>0)
                k=j;
        }
        char t1[11];
        strcpy(t1,tt[k]);
        strcpy(tt[k],tt[i]);
        strcpy(tt[i],t1);
    }
    for(i=0; i<sum; i++)
        puts(tt[i]);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   20 |         gets(t);
      |         ^~~~
      |         getw
a.cc:23:16: error: 'strcmp' was not declared in this scope
   23 |             if(strcmp(t,str[j].a)==0)
      |                ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <math.h>
  +++ |+#include <cstring>
    3 | #define LL long long int
a.cc:33:13: error: 'strcpy' was not declared in this scope
   33 |             strcpy(str[count].a,t);
      |             ^~~~~~
a.cc:33:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:43:13: error: 'strcpy' was not declared in this scope
   43 |             strcpy(tt[sum++],str[i].a);
      |             ^~~~~~
a.cc:43:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:52:16: error: 'strcmp' was not declared in this scope
   52 |             if(strcmp(tt[k],tt[j])>0)
      |                ^~~~~~
a.cc:52:16: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:56:9: error: 'strcpy' was not declared in this scope
   56 |         strcpy(t1,tt[k]);
      |         ^~~~~~
a.cc:56:9: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <boost/foreach.hpp>
using namespace std;

typedef map<string, int> container;
typedef pair<string, int> value_type;

struct second_order {
  bool operator()(const value_type& x, const value_type& y) const {
    if(x.second != y.second){
    	return x.second > y.second;
    }
    else{
      const string xs = x.first, ys = y.first;
      return (strcmp(xs, ys) < 0);
    }
  }
};

int main() {
  container src;
  int n;
  cin >> n;
  
  for(string x; n--; src[x]++){
    cin >> x;
  }
  
  priority_queue<value_type, vector<value_type>, second_order> que;
  pair<string, int> p;
  BOOST_FOREACH(p, src) {
    que.push(p);
  }
  
  while ( !que.empty() ) {
    value_type item = que.top();
    cout << item.first << endl;
    que.pop();
  }
  
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,cnt=0;
string b,maxs[200001];
map<string,int> c;
cin>>a;
for (int i=0;i<a;i++)
{
cin>>b;
c[b]++;
if (c[b]>=maxi)
{
for (int n=0;n<=cnt;n++)
if (b>maxs[n])
{
for (int m=cnt-1;m>=n;m--)
maxs[m]=maxs[m+1];
maxs[n]=b;
}
cnt++;
}
}
for (int i=0;i<cnt;i++)
cout<<maxs[i]<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'maxi' was not declared in this scope; did you mean 'maxs'?
   13 | if (c[b]>=maxi)
      |           ^~~~
      |           maxs
Language: C++

#include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <boost/foreach.hpp>
using namespace std;

typedef map<string, int> container;
typedef pair<string, int> value_type;

struct second_order {
  bool operator()(const value_type& x, const value_type& y) const {
    if(x.second != y.second){
    	return x.second > y.second;
    }
    else{
      string xs = x.first, ys = y.first;
      return (strcmp(xs, ys) < 0);
    }
  }
};

int main() {
  container src;
  int n;
  cin >> n;
  
  for(string x; n--; src[x]++){
    cin >> x;
  }
  
  priority_queue<value_type, vector<value_type>, second_order> que;
  pair<string, int> p;
  BOOST_FOREACH(p, src) {
    que.push(p);
  }
  
  while ( !que.empty() ) {
    value_type item = que.top();
    cout << item.first << endl;
    que.pop();
  }
  
  return 0;
}

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

from collections import Counter
import collections

N = int(input())
a = [input() for i in range(N)]



c = collections.Counter(a)

list = []

for i in range(0,len(c.most_common())-1):
    if(c.most_common()[i][1] == c.most_common()[0][1]):
        list.append(c.most_common()[i][0])

list.sort()
print(' \n'.join(map(str, list)))

    



Compiler output:
main.c:1:1: error: unknown type name 'from'
    1 | from collections import Counter
      | ^~~~
main.c:1:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    1 | from collections import Counter
      |                  ^~~~~~
main.c:1:18: error: unknown type name 'import'
main.c:18:7: warning: multi-character character constant [-Wmultichar]
   18 | print(' \n'.join(map(str, list)))
      |       ^~~~~
Language: C++

#include<bits/stdc++.h>
 using namespace std;
int main()
 {
int n;
cin>>n;
string ar[n];
map<string,int> mp;
for(int i=0;i<n;i++)
 {
cin>>ar[i];
}
int maxi=0;
for(int i=0;i<n;i++)
 {
if(mp.find(ar[i])!=mp.end())
mp[ar[i]]++;
else mp[ar[i]]=1;
maxi=max(maxi,mp[ar[i]]);
}
vector<string> vec;
for(auto i: mp)
  {
  if(i.second == maxi)
   vec.push(i.first);
 }
sort(vec.begin(),vec.end());
 for(int i=0;i<vec.size();i++)
  cout<<vec[i]<<endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:8: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'push'
   25 |    vec.push(i.first);
      |        ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <stack>
#include <math.h>

using namespace std;

typedef long long int ll;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define vsort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())


// a,bの最小公倍数
ll LCM(ll a, ll b){ll lcm = a * b; ll r = a % b;while(r != 0){a = b; b = r; r = a % b;}return lcm /= b;}
// a,bの最大公約数
ll GCD(ll a, ll b){ll r = a % b;while(r != 0){a = b; b = r; r = a % b;}return b;}


const int MOD = 1000000007;
const int INF = INT_MAX;



int main(){

    int n;
    cin >> n;
    string s[n];
    rep(i,n) cin >> s[i];

    sort(s, s+n);

    int mx = 1;
    int tmp = 1;
    for (int i = 1; i < n; i++){
        if (s[i-1] == s[i]){
            tmp++;
            mx = max(mx, tmp);
        }
        else{
            mx = max(mx, tmp);
            tmp = 1;
        }
    }


    tmp = 1;
    for (int i=1; i < n; i++){
        if (tmp == mx) cout << s[i-1] << endl;
        if (s[i-1] == s[i]) {
            tmp++;
        }
        else tmp = 1;
    }
    if (tmp == mx) cout << s[n-1] << endl;

}





//              g++ -std=c++1z


Compiler output:
a.cc:24:17: error: 'INT_MAX' was not declared in this scope
   24 | const int INF = INT_MAX;
      |                 ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <math.h>
  +++ |+#include <climits>
    6 | 
a.cc: In function 'int main()':
a.cc:35:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   35 |     sort(s, s+n);
      |     ^~~~
      |     sqrt
Language: C++

//omajinai c++
#include <iostream>
#include<cmath>
#include<vector>
#include <algorithm>
#include <limits>
#include <numeric>
#include <type_traits>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
constexpr auto mod = 1000000007;

using namespace std;
 
int main() {
int n;
  cin>>n;
  vector<int> a(n)={0};
  vector<string> s(n);
  int maxi=1;
  int kind=0;
  string st;
  int f=0;
  
  rep(i,n){
    cin>>st;
    f=0;
    rep(j,kind){
      if(st==s.at(i)){
        a.at(i)++;
        maxi=max(maxi,a.at(i));
       f=1;
        break;
      }
    }
      if(f==0){ 
        s.at(kind)=st;
        kind++;
       
        a.at(i)=1;
      }
  }
  
  rep(i,kind){
    if(a.at(i)==max){
      cout<<s.at(i)<<endl;
    }
  }
        
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: expected ',' or ';' before '=' token
   18 |   vector<int> a(n)={0};
      |                   ^
a.cc:45:15: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and '<unresolved overloaded function type>' to binary 'operator=='
   45 |     if(a.at(i)==max){
      |        ~~~~~~~^~~~~
a.cc:48:4: error: expected '}' at end of input
   48 |   }
      |    ^
a.cc:15:12: note: to match this '{'
   15 | int main() {
      |            ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		String name[];
		name = new String[200000];
		int num[];
		num = new int[200000]
		int flag = 0;
		
		Scanner sc = new Scanner(System.in);
		int i = sc.nextInt();
		
		for(int j = 0 ;j<i ;j++){
			flag = 0;
			String a = sc.next();
			int listlen = name.length;
			if (listlen == 0){
				name[0] = a;
				num[0] = 1;
			}else{
				for(int k = 0;k<listlen;k++){
					if(name[k]==a){
						num[k] = num[k]+1;
						k = listlen;
						flag = 1;
					}
				}
				if(flag == 0){
					name[listlen] = a;
					num[listlen] = 1;
				}
			}
		}
		
		for(int z=0;z<num.length-1;z++){
			for(int j=num.length-1;j>z;j--){
				if(num[j]<num[j-1]){
					int t=num[j];
					num[j]=num[j-1];
					num[j-1]=t;
					String s=name[j];
					name[j]=name[j-1];
					name[j-1]=s;
				}
			}
		}
		for(int z=0;z<name.length;z++){
			System.out.println(name[z]);
		}	
	}
}

Compiler output:
Main.java:7: error: ';' expected
		num = new int[200000]
		                     ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int num;
    cin >> num;
  
  	int max=0;
  	map<string, int> texts;
  	for (int i=0; i<num; i++) {
      string tmp;
      cin >> tmp;
      texts[tmp]++;
      if (texts[tmp]>max) {
        max = texts[tmp];
      }
    }

  	
  	for (const auto& [key, value] : texts) {
		if (value==max) {
			cout << key << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'map' was not declared in this scope
    9 |         map<string, int> texts;
      |         ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include<iostream>
  +++ |+#include <map>
    2 | using namespace std;
a.cc:9:19: error: expected primary-expression before ',' token
    9 |         map<string, int> texts;
      |                   ^
a.cc:9:21: error: expected primary-expression before 'int'
    9 |         map<string, int> texts;
      |                     ^~~
a.cc:13:7: error: 'texts' was not declared in this scope
   13 |       texts[tmp]++;
      |       ^~~~~
a.cc:20:41: error: 'texts' was not declared in this scope
   20 |         for (const auto& [key, value] : texts) {
      |                                         ^~~~~
Language: C++

#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int MOD=1000000007;

int main(){
    int n,i;
    cin>>n;
    vector<string> s(n);
    rep(i,n){
        cin>>s[i];
    }
    vector<string> ans(0);
    sort(s.begin(),s.end());
    int count=0;
    int _count=0;
    rep(i,n){
        if(s[i].compare(s[i+1])==0 && i!=n-1){
            _count+=1;
        }else{
            if(count<_count){
                ans.erase(ans.begin(),ans.end());
                ans.__emplace_back(s[i]);
                count=_count;
                _count=0;
            }else if(count==_count){
                ans.__emplace_back(s[i]);
                _count=0;
            }
        }
    }
    sort(ans.begin(),ans.end());
    rep(i,ans.size()){
        cout<<ans[i]<<'\n';
    }
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:21: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named '__emplace_back'; did you mean 'emplace_back'?
   45 |                 ans.__emplace_back(s[i]);
      |                     ^~~~~~~~~~~~~~
      |                     emplace_back
a.cc:49:21: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named '__emplace_back'; did you mean 'emplace_back'?
   49 |                 ans.__emplace_back(s[i]);
      |                     ^~~~~~~~~~~~~~
      |                     emplace_back