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

//atcoder abc155
#include<bits/stdc++.h>

using namespace std;
#define int int64_t
#define rep(i,a,n) for(int i=(a); i<(n); ++i)
#define reps(i,a,n) for(int i=(a); i<(n); --i)
#define gsort(x,n) sort((x),(x)+(n),greater<int>())
#define all(x) (x).begin(), (x).end()
#define re(s) reverse((s).begin(),(s).end())
#define setout(n,x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10)
constexpr int INF = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1000000007;
using pii = pair<int,int>;

signed main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    
    int n;
    string s;
    map<string,int> mp;
    vector<pair<int,string> > vp;
    cin >>n;
    
    rep(i,0,n){
      cin >>s;
      mp[s]--;
    }
  
    for(auto itr=mp.begin();itr!=mp.end();itr++){
      vp.emplace_back(itr->se,itr->fi);
    }
    
    sort(all(vp));

    int a=vp[0].first;
    for(int i=0;i<vp.size();i++){
      if(a!=vp[i].first) break;
      cout <<vp[i].second<<'\n';
    }
    return (0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:28: error: 'struct std::pair<const std::__cxx11::basic_string<char>, long int>' has no member named 'se'
   34 |       vp.emplace_back(itr->se,itr->fi);
      |                            ^~
a.cc:34:36: error: 'struct std::pair<const std::__cxx11::basic_string<char>, long int>' has no member named 'fi'
   34 |       vp.emplace_back(itr->se,itr->fi);
      |                                    ^~
Language: C++

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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T1,typename T2> using P = pair< T1, T2 >;
using Pii = P<int,int>;
using Pll = P<LL,LL>;
using Pdd = P<double,double>;
using Psi = P<string,double>;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

int main(){
    int n;
    cin>>n;
    Msi ss;
    REP(i,n){
        string s;
        cin>>s;
        ss[s]++;
    }

    int max_num = 0;
    for(auto p : ss){
        max_num = max(max_num,p.se);
    }

    for(auto p : ss){
        if(p.se == max_num){
            cout<<p.fi<<endl;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: 'Msi' was not declared in this scope; did you mean 'Psi'?
   35 |     Msi ss;
      |     ^~~
      |     Psi
a.cc:39:9: error: 'ss' was not declared in this scope; did you mean 's'?
   39 |         ss[s]++;
      |         ^~
      |         s
a.cc:43:18: error: 'ss' was not declared in this scope; did you mean 'Vs'?
   43 |     for(auto p : ss){
      |                  ^~
      |                  Vs
a.cc:47:18: error: 'ss' was not declared in this scope; did you mean 'Vs'?
   47 |     for(auto p : ss){
      |                  ^~
      |                  Vs
Language: C

#include<stdio.h>
#include<algorithm>
int main()
{
  int n;
  char s[200001];
  int a[200001]={0};
  int cnt=0;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%s",s[i]);
  }
  for(int i=1;i<n;i++){
    if(s[i-1]==s[i]&&s[i-cnt]==s[i]){
      a[i]++;
    }
  }
  for(int i=0;i<n;i++){
    if(a[i]==1){
      printf("%s",s[i]);
    }
  }
  return 0;
}

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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
using namespace std;
map<string,int>mm;
string s;
struct node{
    string s;
    int a;
    bool operator<(const node & t)const{

    }
};
int main()
{
    int n;
    cin >> n;
    while(n--){
        cin >> s;
        mm[s]++;
    }
    int num=0;
    vector<string>v;
    for(auto i:mm){
        if(i.second>num){
            num=i.second;
            v.clear();
            v.push_back(i.first);
        }
        else if(i.second==num){
            cout << i.first <<endl;
            v.push_back(i.first);
        }
    }
    //cout << endl;
    sort(v.begin(),v.end());
    for(auto s:v){
        cout << s << endl;
    }
    return 0;
}


Compiler output:
a.cc: In member function 'bool node::operator<(const node&) const':
a.cc:13:5: warning: no return statement in function returning non-void [-Wreturn-type]
   13 |     }
      |     ^
a.cc: In function 'int main()':
a.cc:24:5: error: 'vector' was not declared in this scope
   24 |     vector<string>v;
      |     ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <map>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:24:18: error: expected primary-expression before '>' token
   24 |     vector<string>v;
      |                  ^
a.cc:24:19: error: 'v' was not declared in this scope
   24 |     vector<string>v;
      |                   ^
Language: C++

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

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

  map<int,string>m;
  
  rep(i,n){
    string s;
    cin>>s;
    m[s]++;
  }

  int mx=0;
  for(auto &&x:m){
    mx=max(x.first,mx);
  }
  
  for(auto &&x:m){
    if(x.first==mx){
    cout<<x.second<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: no match for 'operator[]' (operand types are 'std::map<int, std::__cxx11::basic_string<char> >' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   16 |     m[s]++;
      |      ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = int]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<int, std::__cxx11::basic_string<char> >::key_type&' {aka 'const int&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = int; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, std::__cxx11::basic_string<char> > >; mapped_type = std::__cxx11::basic_string<char>; key_type = int]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::map<int, std::__cxx11::basic_string<char> >::key_type&&' {aka 'int&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

program test03_2
 implicit none
 integer N
 character(len=10),allocatable :: S(:)
 character(len=10),allocatable :: Smax(:)
 integer,allocatable :: Sk(:)
 integer :: kaisuu=1, maxkaisuu=0
 integer i, ii
 integer :: j=1
 integer :: yatta=0

 read *, N
 allocate(S(N))
 allocate(Sk(N))
 allocate(Smax(N))
 do i=1,N
  read *, S(i)
! S(i)=trim(S(i))
 end do

Smax='a'
Sk=0

 call quicksort1(S,1,N)

 do i=1,N-1
  if (S(i)==S(i-1)) then
   Sk(i)=Sk(i)+1
  else
   Sk(i)=1
  end if
 end do

 yatta=MAXVAL(Sk) 

 do i=1,N
  if ( Sk(i) == yatta ) print '(A)', trim(S(i))
 end do

!print *,''
!print '(A)', S(1)


contains
recursive subroutine quicksort1(a, first, last)
  implicit none
   character(len=10),intent(inout)::a(*)
   integer,intent(in)::first,last

   character(len=10)::x,t
   integer::i,j

   x = a((first+last)/2)
   i = first
   j = last
   do 
     do while (a(i) < x)
       i=i+1
     end do
     do while (x < a(j))
       j=j-1
     end do
     if (i >= j) exit
      t = a(i)
      a(i) = a(j)
      a(j) = t
      i=i+1
      j=j-1
   end do
   if (first < i-1) call quicksort1(a, first, i-1)
   if (j+1 < last)  call quicksort1(a, j+1, last)
 return
end subroutine quicksort1

endprogram test03_2


Compiler output:
a.cc:37:31: warning: multi-character character constant [-Wmultichar]
   37 |   if ( Sk(i) == yatta ) print '(A)', trim(S(i))
      |                               ^~~~~
a.cc:40:10: error: empty character constant
   40 | !print *,''
      |          ^~
a.cc:41:8: warning: multi-character character constant [-Wmultichar]
   41 | !print '(A)', S(1)
      |        ^~~~~
a.cc:1:1: error: 'program' does not name a type
    1 | program test03_2
      | ^~~~~~~
Language: C++

n = int(input())
dictionary = {}

for _ in range(n):
    s = input()
    if s in dictionary.keys():
        dictionary[s] = dictionary[s] + 1
    else:
        dictionary[s] = 1


lst = []

for e in dictionary.items():
    lst.append(list(e))

lst.sort(key=lambda x: (-x[1],x[0]))

memo = lst[0][1]
for key,value in lst:
    if value == memo:
        print(key)
    else:
        break

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
    int n,i,maxx=0,x;
    string str;
    map<string,int>mp;
    map<string,int>::iterator it;

    cin>>n;
    for(i=0; i<n; i++)
    {
        cin>>str;
        if(mp.count(str)==0)
        {
            mp.insert(make_pair(str,1));
        }
        else mp[str]++;
        maxx=max(mp[str],maxx);
    }
    for(it=mp.begin(); it!=mp.end(); it++)
    {
        x=it.second;
        str=it.first;
        if(x==maxx)cout<<str<<endl;

    }



    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: 'std::map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> > >::iterator'} has no member named 'second'
   25 |         x=it.second;
      |              ^~~~~~
a.cc:26:16: error: 'std::map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> > >::iterator'} has no member named 'first'
   26 |         str=it.first;
      |                ^~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: conflicting declaration 'auto s'
   13 |     map[s]++;
      |         ^
a.cc:11:12: note: previous declaration as 'std::string s'
   11 |     string s;
      |            ^
a.cc:13:11: error: expected initializer before '++' token
   13 |     map[s]++;
      |           ^~
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <utility>
 
int main()
{
  std::map<char*,int> doc;
  int n;
  std::cin>>n;
  int max = 0;
  for(int i=0; i<n; ++i){
  	char* lit;
    std::cin>>lit;
    if(!doc.count(lit))
      doc.emplace(lit,1);
    else{
      doc[lit]++; 
      if(max < doc[lit])
        max = doc[lit];
    }
  }
   std::for_each(doc.begin(), doc.end(), [&](std::map<char*,int>::value_type p){
   	if(p.second==max)
      std::cout<<p.first<<std::endl;
   }
)}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:2: error: expected ';' before '}' token
   27 | )}
      |  ^
      |  ;
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <utility>
 
int main()
{
  std::map<char*,int> doc;
  int n;
  std::cin>>n;
  int max = 0;
  for(int i=0; i<n; ++i){
  	char* lit;
    std::cin>>lit;
    if(!doc.count(lit))
      doc.emplace(lit,1);
    else{
      doc[lit]++; 
      if(max < doc[lit])
        max = doc[lit];
    }
  }
   std::for_each(doc.begin(), doc.end(), [](std::map<char*,int>::value_type p){
   	if(p.second==max)
      std::cout<<p.first<<std::endl;
   }
}

Compiler output:
a.cc: In lambda function:
a.cc:24:22: error: 'max' is not captured
   24 |         if(p.second==max)
      |                      ^~~
a.cc:23:43: note: the lambda has no capture-default
   23 |    std::for_each(doc.begin(), doc.end(), [](std::map<char*,int>::value_type p){
      |                                           ^
a.cc:11:7: note: 'int max' declared here
   11 |   int max = 0;
      |       ^~~
a.cc: In function 'int main()':
a.cc:26:5: error: expected ')' before '}' token
   26 |    }
      |     ^
      |     )
   27 | }
      | ~    
a.cc:23:17: note: to match this '('
   23 |    std::for_each(doc.begin(), doc.end(), [](std::map<char*,int>::value_type p){
      |                 ^
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <utility>
 
int main()
{
  std::map<char*,int> doc;
  int n;
  std::cin>>n;
  int max = 0;
  for(int i=0; i<n; ++i){
  	char* lit;
    std::cin>>lit;
    if(!doc.count(lit))
      doc.emplace(lit,1);
    else{
      doc[lit]++; 
      if(max < doc[lit])
        max = doc[lit];
    }
  }
   std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
   	if(p.second==max)
      std::cout<<p.first<<std::endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:45: error: 'std::unordered_map' has not been declared
   23 |    std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
      |                                             ^~~
a.cc:23:63: error: expected ',' or '...' before '<' token
   23 |    std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
      |                                                               ^
a.cc: In lambda function:
a.cc:24:12: error: 'p' was not declared in this scope
   24 |         if(p.second==max)
      |            ^
a.cc:24:22: error: 'max' is not captured
   24 |         if(p.second==max)
      |                      ^~~
a.cc:23:43: note: the lambda has no capture-default
   23 |    std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
      |                                           ^
a.cc:11:7: note: 'int max' declared here
   11 |   int max = 0;
      |       ^~~
a.cc: In function 'int main()':
a.cc:26:5: error: expected ')' before '}' token
   26 |    }
      |     ^
      |     )
   27 | }
      | ~    
a.cc:23:17: note: to match this '('
   23 |    std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
      |                 ^
Language: C++

#include <iostream>
#include <unordered_map>
#include <algorithm>
#include <utility>

int main()
{
  std::map<char*,int> doc;
  int n;
  std::cin>>n;
  int max = 0;
  for(int i=0; i<n; ++i){
  	char* lit;
    std::cin>>lit;
    if(!doc.count(lit))
      doc.emplace(lit,1);
    else{
      doc[lit]++; 
      if(max < doc[lit])
        max = doc[lit];
    }
  }
   std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
   	if(p.second==max)
      std::cout<<p.first<<std::endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'map' is not a member of 'std'
    8 |   std::map<char*,int> doc;
      |        ^~~
a.cc:5:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    4 | #include <utility>
  +++ |+#include <map>
    5 | 
a.cc:8:12: error: expected primary-expression before 'char'
    8 |   std::map<char*,int> doc;
      |            ^~~~
a.cc:15:9: error: 'doc' was not declared in this scope
   15 |     if(!doc.count(lit))
      |         ^~~
a.cc:23:18: error: 'doc' was not declared in this scope
   23 |    std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
      |                  ^~~
a.cc: In lambda function:
a.cc:24:22: error: 'max' is not captured
   24 |         if(p.second==max)
      |                      ^~~
a.cc:23:43: note: the lambda has no capture-default
   23 |    std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
      |                                           ^
a.cc:11:7: note: 'int max' declared here
   11 |   int max = 0;
      |       ^~~
a.cc: In function 'int main()':
a.cc:26:5: error: expected ')' before '}' token
   26 |    }
      |     ^
      |     )
   27 | }
      | ~    
a.cc:23:17: note: to match this '('
   23 |    std::for_each(doc.begin(), doc.end(), [](std::unordered_map<char*,int>::value_type p){
      |                 ^
Language: Java

import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    List<String> list = new ArrayList<String>();
    int N = scan.nextInt();
    for(int i = 0;i < N;i++){
      list.add(scan.nextLine());
    }
    Map<String,Integer> map = new HashMap<String,Integer>();
    List<Integer> list2 = new ArrayList<Integer>();
    for(int i = 0;i < N;i++){
      list2.set(i,0);
      for(int j = 0;j < N-1;j++){
        if(list.get(i) == list.get(j)){
          list2.set(i,list.get(i)+1);
        }
      }
    }
  }
}


Compiler output:
Main.java:21: error: incompatible types: String cannot be converted to Integer
          list2.set(i,list.get(i)+1);
                                 ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll =long long;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}
const ll INF = 1LL << 60;

//Write From this Line

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


Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   27 |                 mp[s++];
      |                    ~^~
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(){
    Scanner scan = new Scanner(System.in);
    List<String> list = new ArrayList<String>();
    int N = scan.nextInt();
    for(int i = 0;i < N;i++){
      list.add(scan.nextInt);
    }
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    List<String> list = new ArrayList<String>();
    ^
  symbol:   class List
  location: class Main
Main.java:6: error: cannot find symbol
    List<String> list = new ArrayList<String>();
                            ^
  symbol:   class ArrayList
  location: class Main
Main.java:9: error: cannot find symbol
      list.add(scan.nextInt);
                   ^
  symbol:   variable nextInt
  location: variable scan of type Scanner
3 errors
Language: C++

#include<iostream>
#include<map>
using namespace std;
map<string, int>mo;
int main()
{
	int n;
	cin >> n;
	string s;
	for (int i = 0; i < n; i++)
	{
		cin >> s;
		mo[s]++;
	}
	int maxn = -1;
	for (const auto& x : mo)
	{
		int v = x.second;
		if (v > maxn)maxn = v;
	}
	for (auto p = mo.begin(); p != mo.end(); p++)
	{
		if (p.second == maxn)cout << p.first << endl;
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: 'struct std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >' has no member named 'second'
   23 |                 if (p.second == maxn)cout << p.first << endl;
      |                       ^~~~~~
a.cc:23:48: error: 'struct std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >' has no member named 'first'
   23 |                 if (p.second == maxn)cout << p.first << endl;
      |                                                ^~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'stirng' was not declared in this scope
   11 |     stirng s;
      |     ^~~~~~
a.cc:12:12: error: 's' was not declared in this scope
   12 |     cin >> s;
      |            ^
a.cc:16:42: error: expression cannot be used as a function
   16 |   for (auto p : mp) mx = max(mx, p.second());
      |                                  ~~~~~~~~^~
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

/*** chmax, chmin ***/
// a < b ならば a を b で更新
// 更新されたら true を返す
template <typename T>
bool chmax(T &a, const T &b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
// a > b ならば a を b で更新
// 更新されたら true を返す
template <typename T>
bool chmin(T &a, const T &b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
/*** chmax, chmin ここまで ***/

void Main()
{
    int n;
    cin >> n;
  	vector<string> s(n);
  	rep(i,n) cin >> s[i];
    
  	sort(all(s));
  	map<string, int> mp;
  
    rep(i,n){
	  	mp[s[i]]++;
    }

  	int mx = 0;
  	auto(p:mp){
    	chmax(mx, p.second);
    }
  	
	auto(p:mp){
    	if(p.second == mx) {
			cout << p.first << endl;
        }
    }
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:55:15: error: found ':' in nested-name-specifier, expected '::'
   55 |         auto(p:mp){
      |               ^
      |               ::
a.cc:55:14: error: 'p' was not declared in this scope; did you mean 'mp'?
   55 |         auto(p:mp){
      |              ^
      |              mp
a.cc:55:9: warning: 'auto(x)' only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   55 |         auto(p:mp){
      |         ^~~~~~~~~~
a.cc:59:15: error: found ':' in nested-name-specifier, expected '::'
   59 |         auto(p:mp){
      |               ^
      |               ::
a.cc:59:9: warning: 'auto(x)' only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   59 |         auto(p:mp){
      |         ^~~~~~~~~~
a.cc:59:9: error: expected primary-expression before 'auto'
   59 |         auto(p:mp){
      |         ^~~~
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

/*** chmax, chmin ***/
// a < b ならば a を b で更新
// 更新されたら true を返す
template <typename T>
bool chmax(T &a, const T &b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
// a > b ならば a を b で更新
// 更新されたら true を返す
template <typename T>
bool chmin(T &a, const T &b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
/*** chmax, chmin ここまで ***/

void Main()
{
    int n;
    cin >> n;
  	vector<string> s(n);
  	rep(i,n) cin >> s[i];
    
  	sort(all(s));
  	map<string, int> mp;
  
    rep(i,n){
	  	mp(s[i])++;
    }

  	int mx = 0;
  	auto(p:mp){
    	chmax(mx, p.second);
    }
  	
	auto(p:mp){
    	if(p.second == mx) {
			cout << p.first << endl;
        }
    }
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:51:19: error: no match for call to '(std::map<std::__cxx11::basic_string<char>, int>) (__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)'
   51 |                 mp(s[i])++;
      |                 ~~^~~~~~
a.cc:55:15: error: found ':' in nested-name-specifier, expected '::'
   55 |         auto(p:mp){
      |               ^
      |               ::
a.cc:55:14: error: 'p' was not declared in this scope; did you mean 'mp'?
   55 |         auto(p:mp){
      |              ^
      |              mp
a.cc:55:9: warning: 'auto(x)' only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   55 |         auto(p:mp){
      |         ^~~~~~~~~~
a.cc:59:15: error: found ':' in nested-name-specifier, expected '::'
   59 |         auto(p:mp){
      |               ^
      |               ::
a.cc:59:9: warning: 'auto(x)' only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   59 |         auto(p:mp){
      |         ^~~~~~~~~~
a.cc:59:9: error: expected primary-expression before 'auto'
   59 |         auto(p:mp){
      |         ^~~~
Language: C

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

int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}



int main (){
    int N,f;
    int K[200100],L[200100];
    int e=0,c=0;
    char S[500][200100],tmp[200100],ans[500][200100];
    
  scanf("%d",&N);
    for(int g=0;g<N;g++){
       scanf("%s",S[g]);
    }
  

for(int i=1;i<N;i++){
    for(int j=1;j<N;j++){
      if(strcmp(S[j-1], S[j])>0){
        strcpy(tmp, S[j-1]);
        strcpy(S[j-1], S[j]);
        strcpy(S[j], tmp);
      }
    }
  }
  
  for(f=0;f<N;f++){
   
  if(strcmp(S[f],S[f+1])==0){
    K[e]+=1;
    L[e]+=1;
    strcpy(ans[e], S[f]);
  }else{
     strcpy(ans[e], S[f]);
  e++;
  }
    
  }
    qsort(L, e, sizeof(int), compare_int);
  
  for(int h=0;h<f;h++){
  if(K[a]==L[e-1]){
    printf("%s\n",ans[h]);
  }else if(L[e-1]==0){
  printf("%s\n",ans[h]);
  }
  }
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:45:5: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   45 |     qsort(L, e, sizeof(int), compare_int);
      |     ^~~~~
main.c:48:8: error: 'a' undeclared (first use in this function)
   48 |   if(K[a]==L[e-1]){
      |        ^
main.c:48:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cassert>
#include <utility>
#include <numeric>
#include <cstring>
#include <map>
#include <set>
#include <cmath>
#define rep(i,n) for (int i=0; i<(n); ++i)

using namespace std;
using ll = long long;

map<string,int>m;

int main (){   
    int N;
    
    cin >> N;
    vector<string> S(N);
    

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

    int max = 0;
    (const auto& x : m){
        
        if(x.second >= max){
            max=x.second;
            cout << x.first <<endl;
        }
        else break;

    }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:20: error: found ':' in nested-name-specifier, expected '::'
   35 |     (const auto& x : m){
      |                    ^
      |                    ::
a.cc:35:6: error: expected primary-expression before 'const'
   35 |     (const auto& x : m){
      |      ^~~~~
a.cc:35:6: error: expected ')' before 'const'
   35 |     (const auto& x : m){
      |     ~^~~~~
      |      )
Language: C++

#include<iostream>
#include<algorithm>
#include<map>
#include<string> 
#include<set>
//#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	int n;
	cin>>n;
	map<string,int>mp;
	set<string>str;
	string s;
	for(int i=1;i<=n;i++){
		cin>>s;
		mp[s]++;
		str.insert(s);
	}
	int maxn=0;
	map<string,int>::iterator it=mp.begin();
	for(auto i:mp){
		maxn=max(maxn,i->second);
	}
//	while(it!=mp.end()){
//		maxn=max(maxn,it->second);
//		it++;
//	}
	set<string>::iterator itt=str.begin();
	while(itt!=str.end()){
		if(mp[*itt]==maxn)
		cout<<*itt<<endl;
		itt++;
	}
	return 0;
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: base operand of '->' has non-pointer type 'std::pair<const std::__cxx11::basic_string<char>, int>'
   24 |                 maxn=max(maxn,i->second);
      |                                ^~
Language: C++

#include<iostream>
#include<algorithm>
#include<map>
#include<string> 
#include<set>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	int n;
	cin>>n;
	map<string,int>mp;
	set<string>str;
	string s;
	for(int i=1;i<=n;i++){
		cin>>s;
		mp[s]++;
		str.insert(s);
	}
	int maxn=0;
	map<string,int>::iterator it=mp.begin();
	for(auto i:mp){
		maxn=max(maxn,i->second);
	}
//	while(it!=mp.end()){
//		maxn=max(maxn,it->second);
//		it++;
//	}
	set<string>::iterator itt=str.begin();
	while(itt!=str.end()){
		if(mp[*itt]==maxn)
		cout<<*itt<<endl;
		itt++;
	}
	return 0;
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: base operand of '->' has non-pointer type 'std::pair<const std::__cxx11::basic_string<char>, int>'
   24 |                 maxn=max(maxn,i->second);
      |                                ^~
Language: C++

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

int main(){
        int n;
        cin>>n;
        vector<string>s(n);
        map<string,int> mp;
        for(int i=0;i<n;i++){
                cin>>s[i];
                mp[s[i]]++;
        }
        auto itr=mp.end();
        itr--;
        int tmp=itr->second;
        for(auto itr=mp.begin();itr!=mp.end();itr++){
                if(tmp==itr->second){
                        cout<<itr->first<<endl;
                }
        }
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>>n;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<map>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:9:9: error: 'vector' was not declared in this scope
    9 |         vector<string>s(n);
      |         ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include<map>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:9:22: error: expected primary-expression before '>' token
    9 |         vector<string>s(n);
      |                      ^
a.cc:9:23: error: 's' was not declared in this scope
    9 |         vector<string>s(n);
      |                       ^
a.cc:20:25: error: 'cout' was not declared in this scope
   20 |                         cout<<itr->first<<endl;
      |                         ^~~~
a.cc:20:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:43: error: 'endl' was not declared in this scope
   20 |                         cout<<itr->first<<endl;
      |                                           ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<map>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class atcoder0216_C{
//public class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		List<String> S = new ArrayList<String>();
		List<String> I = new ArrayList<String>();
		List<Integer> C = new ArrayList<Integer>();

		int N = scan.nextInt();
		for(int i=0;i<N;i++) {
			S.add(scan.next());
		}

		Collections.sort(S);

		int j = 0;
		boolean flag = false;
		I.add(S.get(0));

		for(int i =1; i<N; i++) {
			if(S.get(i).equals(S.get(i-1))) {
				flag = true;
				j++;
				if(i==N-1) {
					C.add(j);
				}
			}else if((S.get(i).equals(S.get(i-1)))==false){
				I.add(S.get(i));
				C.add(j);
				j =0;
			}
		}

		if(!flag) {
			C.add(j);
		}

		int x = 0;
		int y = 0;
		List<Integer> max = new ArrayList<Integer>();
		List<String> result = new ArrayList<String>();

		for(int count:C) {
			if(x==0) {
				max.add(C.get(0));
				result.add(I.get(0));
			}else {
				if(max.get(y)==count) {
					result.add(I.get(x));
				}else if(max.get(y)<count) {
					max.clear();
					result.clear();
					max.add(C.get(x));
					result.add(I.get(x));
				}
			}
			x++;
		}

		for(String view:result) {
			System.out.println(view);
		}
		//		}
	}
}



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

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class atcoder0216_C{
	public class Main{
//	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		List<String> S = new ArrayList<String>();
		List<String> I = new ArrayList<String>();
		List<Integer> C = new ArrayList<Integer>();

		int N = scan.nextInt();
		for(int i=0;i<N;i++) {
			S.add(scan.next());
		}

		Collections.sort(S);

		int j = 0;
		boolean flag = false;
		I.add(S.get(0));

		for(int i =1; i<N; i++) {
			if(S.get(i).equals(S.get(i-1))) {
				flag = true;
				j++;
				if(i==N-1) {
					C.add(j);
				}
			}else if((S.get(i).equals(S.get(i-1)))==false){
				I.add(S.get(i));
				C.add(j);
				j =0;
			}
		}

		if(!flag) {
			C.add(j);
		}

		int x = 0;
		int y = 0;
		List<Integer> max = new ArrayList<Integer>();
		List<String> result = new ArrayList<String>();

		System.out.println(I);
		System.out.println(C);

		for(int count:C) {
			if(x==0) {
				max.add(C.get(0));
				result.add(I.get(0));
			}else {
				if(max.get(y)==count) {
					result.add(I.get(x));
				}else if(max.get(y)<count) {
					max.clear();
					result.clear();
					max.add(C.get(x));
					result.add(I.get(x));
				}
			}
			x++;
		}

		for(String view:result) {
			System.out.println(view);
		}
		//		}
	}
}



Compiler output:
Main.java:15: error: illegal start of type
		for(int i=0;i<N;i++) {
		^
Main.java:15: error: > or ',' expected
		for(int i=0;i<N;i++) {
		               ^
Main.java:15: error: <identifier> expected
		for(int i=0;i<N;i++) {
		                 ^
Main.java:19: error: <identifier> expected
		Collections.sort(S);
		                ^
Main.java:19: error: <identifier> expected
		Collections.sort(S);
		                  ^
Main.java:23: error: <identifier> expected
		I.add(S.get(0));
		     ^
Main.java:23: error: <identifier> expected
		I.add(S.get(0));
		           ^
Main.java:25: error: illegal start of type
		for(int i =1; i<N; i++) {
		^
Main.java:25: error: > or ',' expected
		for(int i =1; i<N; i++) {
		                 ^
Main.java:25: error: <identifier> expected
		for(int i =1; i<N; i++) {
		                    ^
Main.java:39: error: illegal start of type
		if(!flag) {
		^
Main.java:39: error: <identifier> expected
		if(!flag) {
		        ^
Main.java:48: error: <identifier> expected
		System.out.println(I);
		                  ^
Main.java:48: error: <identifier> expected
		System.out.println(I);
		                    ^
Main.java:49: error: <identifier> expected
		System.out.println(C);
		                  ^
Main.java:49: error: <identifier> expected
		System.out.println(C);
		                    ^
Main.java:51: error: illegal start of type
		for(int count:C) {
		^
Main.java:51: error: ';' expected
		for(int count:C) {
		             ^
Main.java:51: error: <identifier> expected
		for(int count:C) {
		               ^
Main.java:68: error: illegal start of type
		for(String view:result) {
		^
Main.java:68: error: ';' expected
		for(String view:result) {
		               ^
Main.java:68: error: <identifier> expected
		for(String view:result) {
		                      ^
22 errors
Language: C++

#include <iostream>

using namespace std;

int main(){
    int n;
    cin >> n;
    string s[n];
    for(int i=0;i<n;i++){
        cin >> s[i];
    }
    string ans[n];
    //s[n]="zzzz";
    sort(s,s+n);
    ans[0]=s[0];
    int x=1;
    int max=0;
    int k=0;
    for(int j=0;j<n;j++){
        if(j<n-1){
            if(s[j]==s[j+1]){
                x++;
            }
            else{
                if(max<x){
                    k=0;
                    ans[k]=s[j];
                    max=x;
                }
                else if(max==x){
                    k++;
                    ans[k]=s[j];
                }

                x=1;
            }
        }
        else{
            if(max<x){
                k=0;
                ans[k]=s[j];
                max=x;
            }
            else if(max==x){
                k++;
                ans[k]=s[j];
            }
        }
    }
    
    
    for(int l=0;l<=k;l++){
       cout << ans[l] << endl;
    }

    
    return 0;
}

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

import java.util.*;
public class ABC155C {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else map.put(s, 1);
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max) list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) sb.append(key+"\n");
		System.out.println(new String(sb));
	}
}

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

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

int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}



int main (){
    int N,j;
    int K[200100],L[200100];
    int e=0,c=0;
    char S[20][200100],tmp[200100],ans[20][200100];
    scanf("%d",&N);
    for(int a=0;a<N;a++){
       scanf("%s",S[a]);
    }
  

for(int i=1;i<N;i++){
    for(int j=1;j<N;j++){
      if(strcmp(S[j-1], S[j])>0){
        strcpy(tmp, S[j-1]);
        strcpy(S[j-1], S[j]);
        strcpy(S[j], tmp);
      }
    }
  }
  for(int f=0;j<N;j++){
    
  if(strcmp(S[j],S[j+1])==0){
    K[e]++;
    ans[e]=S[f];
    L[e]++;
    printf("%s",ans[e]);
    
  }else{
  e++;
  }
    
  }
    qsort(S, N, sizeof(int), compare_int);
  for(int a=e;0<a;a--){
  if(K[a]==L[e]){
    printf("%s",ans[a]);
  }
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:11: error: assignment to expression with array type
   35 |     ans[e]=S[f];
      |           ^
main.c:44:5: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   44 |     qsort(S, N, sizeof(int), compare_int);
      |     ^~~~~
Language: Java

import java.util.*;

public class ABC155C {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1, rem = 0;
		Map<String, Integer> map = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) if(map.get(key) == max)list.add(key);
		Collections.sort(list);
		StringBuilder sb = new StringBuilder();
		for(String key : list) {
			sb.append(key);
			sb.append('\n');
		}
		System.out.println(new String(sb));
	}
}

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

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

using namespace std;


int main(){
    int N;
    cin>>N;
    
    string S[N];
    for(int i=0;i!=N;++i){
        cin>>S[i];
    }
    
    set<string> s;
    
    for(int i=0;i!=N;++i){
        s.insert(S[i]);
    }
  
    map<string,int> m;
    for(auto p=s.begin();p!=s.end();++p){
        
        int n=0;
        for(int j=0;j!=N;++j){
            if(*p==S[j]){
                ++n;
            }
        }
        m.insert(make_pair(*p,n));
    }
    vector<string> vs;
    int max=0;
 
    for(auto p=m.begin();p!=m.end();++p){
        if(max<(p->second)){
            max=(p->second);
        }
    }
    
    for(auto p=m.begin();p!=m.end();++p){
        if(max==(p->second)){
            vs.push_back(p->first);
        }
    }
    
    sort(vs.begin(),vs.end());
    for(auto a:vs){
        cout<<a<<endl;
    }
     
    
}


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

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<map>
using namespace std;
typedef long long ll;
map<string,int>q;
vector<string>res;
string a;
int main()
{
	int n;cin>>n;
	for(int i=1;i<=n;++i)
		cin>>a,q[a]++;
	for(auto v:q)
		if(v.second>=2)res.push_back(v.first);
	sort(res.begin(),res.end());
	for(auto v:res)
		cout<<v<<endl;
	return 0;
}

Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<string>res;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:17:32: error: 'res' was not declared in this scope
   17 |                 if(v.second>=2)res.push_back(v.first);
      |                                ^~~
a.cc:18:14: error: 'res' was not declared in this scope
   18 |         sort(res.begin(),res.end());
      |              ^~~
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(data,data+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)!=0){
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 <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
  int n;
  cin >> n;
  map<string, int> vote;
  string poll[n];
  for(int i=0; i<n; i++){
    cin >> poll[i];
    if(vote.count(poll[i])){
      vote[poll[i]]++;
    }
    else{
      vote[poll[i]] = 1;
    }
  }
  //cout << "beet" << vote.at("beet") << endl;
  int N = vote.size();
  map<int, string> poll2[N]
  for(int i=0; i<n; i++){
    poll2[vote.at(poll[i])] = poll[i];
  }
  for(int i=10000000; i>0; i--){
    cout << poll2.at(i) << endl;
  }

    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: expected initializer before 'for'
   22 |   for(int i=0; i<n; i++){
      |   ^~~
a.cc:22:16: error: 'i' was not declared in this scope
   22 |   for(int i=0; i<n; i++){
      |                ^
a.cc:26:13: error: 'poll2' was not declared in this scope; did you mean 'poll'?
   26 |     cout << poll2.at(i) << endl;
      |             ^~~~~
      |             poll
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)!=0){
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