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

import java.util.*;
public class Main {
	public static void main(String[] args){
		String name[] = new String[];
		int num[] = new int[];
		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:4: error: array dimension missing
		String name[] = new String[];
		                            ^
Main.java:5: error: array dimension missing
		int num[] = new int[];
		                     ^
2 errors
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<map>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int N;
    cin >> N;
    string S[N];
    rep(i,N) cin >> S[i];

    map<string, int> map;
    rep(i,N) {
        if (map.find(S[i]) == map.end()) map[S[i]] = 0;
        else map[S[i]] += 1;
    }

    int max = 0;
    vector<string> vec;
    for (auto i = map.begin(); i != map.end(); ++i) {
        if (max < i->second) {
            vec.clear();
            vec.push_back(i->first);
        }
        if (max == i->second) {
            vec.push_back(i->first);
        }
    }

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

    for (string s : vec) {
        cout << s << endl;
    }

    return 0;
}


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

import java.util.*;
public class Main {
	public static void main(String[] args){
		String name[];
		int num[];
		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:14: error: variable name might not have been initialized
			int listlen = name.length;
			              ^
Main.java:17: error: variable num might not have been initialized
				num[0] = 1;
				^
Main.java:21: error: variable num might not have been initialized
						num[k] = num[k]+1;
						^
Main.java:28: error: variable num might not have been initialized
					num[listlen] = 1;
					^
Main.java:33: error: variable num might not have been initialized
		for(int z=0;z<num.length-1;z++){
		              ^
Main.java:39: error: variable name might not have been initialized
					String s=name[j];
					         ^
Main.java:45: error: variable name might not have been initialized
		for(int z=0;z<name.length;z++){
		              ^
7 errors
Language: C++

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

typedef std::map<std::string, int> container;
typedef std::pair<std::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{
      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: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		String name[];
		int num[];
		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 i=0;i<num.length-1;i++){
			for(int j=num.length-1;j>i;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 i=0;i<name.length;i++){
			System.out.println(name[i]);
		}	
	}
}

Compiler output:
Main.java:33: error: variable i is already defined in method main(String[])
		for(int i=0;i<num.length-1;i++){
		        ^
Main.java:39: error: cannot find symbol
					string s=name[j];
					^
  symbol:   class string
  location: class Main
Main.java:45: error: variable i is already defined in method main(String[])
		for(int i=0;i<name.length;i++){
		        ^
3 errors
Language: C++

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

int main() {
    int a,i;
    string b;
    map<string,int> mp;
    scanf("%d\n",&a);
    for(i=0;i<a;i++){        
        cin>>b;
        auto itr = mp.find(b);
        if(itr == mp.end()){
            mp[b] = 1;
        }
        else{
            mp[b]++;
        }
    }
    for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
    //    std::cout << "key = " << itr->first           // キーを表示
      //                  << ", val = " << itr->second << "\n";    // 値を表示
    }
    map<int,vector<string>> mp2;
    int maxv = 0;
    for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
        mp2[itr->second].push_back(itr->first);
        maxv = max(maxv,itr->second);
    };
    //cout<<maxv<<endl;
    for(auto itr = mp2.begin(); itr != mp2.end(); ++itr) {
        //std::cout << "key = " << itr->first;
        if(maxv == itr->first){
            int n = itr->second.size();
            sort(itr->second.begin(),itr->second.end());
            for(int i=0;i<n;i++){
                cout<<itr->second[i]<<endl;
            };
        }
    }    // 値を表示    
}

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

#include<iostream>
#include<cmath>
#include<vector>
#include<map>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int N;
    cin >> N;
    string S[N+1];
    rep(i,N) cin >> S[i];

    map<string, int> map;
    rep(i,N) {
        if (map.find(S[i]) == map.end()) map[S[i]] = 0;
        else map[S[i]] += 1;
    }

    int max = 0;
    vector<string> vec;
    for (auto i = map.begin(); i != map.end(); ++i) {
        if (max < i->second) {
            vec.clear();
            vec.push_back(i->first);
        }
        if (max == i->second) {
            vec.push_back(i->first);
        }
    }

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

    for (string s : vec) {
        cout << s << endl;
    }

    return 0;
}

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

import java.util.*;
public class Main {
	public static void main(String[] args){
		String name[];
		int num[];
		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.nextString();
			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 i=0;i<num.length-1;i++){
			for(int j=num.length-1;j>i;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 i=0;i<name.length;i++){
			System.out.println(name[i]);
		}	
	}
}

Compiler output:
Main.java:13: error: cannot find symbol
			String a = sc.nextString();
			             ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:33: error: variable i is already defined in method main(String[])
		for(int i=0;i<num.length-1;i++){
		        ^
Main.java:39: error: cannot find symbol
					string s=name[j];
					^
  symbol:   class string
  location: class Main
Main.java:45: error: variable i is already defined in method main(String[])
		for(int i=0;i<name.length;i++){
		        ^
4 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		String name[];
		int num[];
		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.nextInt();
			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;
					name[listlen] = 1;
				}
			}
		}
		
		for(int i=0;i<num.length-1;i++){
			for(int j=num.length-1;j>i;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]=t;
				}
			}
		}
		for(int i=0;i<name.length;i++){
			System.out.println(name[i]);
		}	
	}
}

Compiler output:
Main.java:13: error: incompatible types: int cannot be converted to String
			String a = sc.nextInt();
			                     ^
Main.java:28: error: incompatible types: int cannot be converted to String
					name[listlen] = 1;
					                ^
Main.java:33: error: variable i is already defined in method main(String[])
		for(int i=0;i<num.length-1;i++){
		        ^
Main.java:39: error: cannot find symbol
					string s=name[j];
					^
  symbol:   class string
  location: class Main
Main.java:41: error: incompatible types: int cannot be converted to String
					name[j-1]=t;
					          ^
Main.java:45: error: variable i is already defined in method main(String[])
		for(int i=0;i<name.length;i++){
		        ^
6 errors
Language: C++

#include <iostream>
#include<cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
char s[200001][11];
int  a[200001]={0};
char s1[]="0";
int main()
{
    int n,i,j;
    scanf("%d",&n);
    getchar();
    for(i=0;i<n;i++)
        gets(s[i]);
    for(i=0;i<n;i++)
    {
        if(strcmp(s[i],s1)==0)continue;
        for(j=0;j<n;j++)
        {
            if(strcmp(s[i],s[j])==0)a[i]++;
            //strcpy(s[j],s1);
        }
    }
    for(i=1;i<n;i++)
    {
        for(j=0;j<i;j++)
        {
            if(strcmp(s[i],s[j])==0)a[i]=0;
        }
    }
    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]);
    }
    return 0;
}

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

import java.util.*;
public class Main {
	public static void main(String[] args){
		String name[];
		int num[];
		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.nextInt();
			int listlen = name.length;
			if (listlen == 0){
				string[0] = a;
				num[0] = 1;
			}else{
				for(int k = 0;k<listlen;k++){
					if(string[k]==a){
						num[k] = num[k]+1;
						k = listlen;
						flag = 1;
					}
				}
				if(flag == 0){
					string[listlen] = a;
					name[listlen] = 1;
				}
			}
		}
		
		for(int i=0;i<num.length-1;i++){
			for(int j=num.length-1;j>i;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]=t;
				}
			}
		}
		for(int i=0;i<name.length;i++){
			System.out.println(name[i]);
		}	
	}
}

Compiler output:
Main.java:13: error: incompatible types: int cannot be converted to String
			String a = sc.nextInt();
			                     ^
Main.java:16: error: cannot find symbol
				string[0] = a;
				^
  symbol:   variable string
  location: class Main
Main.java:20: error: cannot find symbol
					if(string[k]==a){
					   ^
  symbol:   variable string
  location: class Main
Main.java:27: error: cannot find symbol
					string[listlen] = a;
					^
  symbol:   variable string
  location: class Main
Main.java:28: error: incompatible types: int cannot be converted to String
					name[listlen] = 1;
					                ^
Main.java:33: error: variable i is already defined in method main(String[])
		for(int i=0;i<num.length-1;i++){
		        ^
Main.java:39: error: cannot find symbol
					string s=name[j];
					^
  symbol:   class string
  location: class Main
Main.java:41: error: incompatible types: int cannot be converted to String
					name[j-1]=t;
					          ^
Main.java:45: error: variable i is already defined in method main(String[])
		for(int i=0;i<name.length;i++){
		        ^
9 errors
Language: Java


import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
import com.sun.javafx.image.IntPixelGetter;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    final int n = scanner.nextInt();
    Map<String, Integer> s = new TreeMap<>();

    for (int i = 0; i < n; i++) {
      String tmp = scanner.next();
      if(!s.containsKey(tmp)) {
        s.put(tmp,1);
      } else {
        s.put(tmp, s.get(tmp) + 1);
      }
    }
    int max = s.values().stream().mapToInt(e -> e).max().getAsInt();
    s.entrySet().stream().filter(e->e.getValue() == max).forEach(e -> System.out.println(e.getKey()));
  }
}


Compiler output:
Main.java:7: error: package com.sun.javafx.image does not exist
import com.sun.javafx.image.IntPixelGetter;
                           ^
1 error
Language: Java

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

Compiler output:
Main.java:16: error: cannot find symbol
				string[0] = a;
				^
  symbol:   variable string
  location: class Main
Main.java:20: error: cannot find symbol
					if(string[k]==a){
					   ^
  symbol:   variable string
  location: class Main
Main.java:27: error: cannot find symbol
					string[listlen] = a;
					^
  symbol:   variable string
  location: class Main
Main.java:28: error: incompatible types: int cannot be converted to String
					name[listlen] = 1;
					                ^
Main.java:33: error: variable i is already defined in method main(String[])
		for(int i=0;i<num.length-1;i++){
		        ^
Main.java:39: error: cannot find symbol
					string s=name[j];
					^
  symbol:   class string
  location: class Main
Main.java:41: error: incompatible types: int cannot be converted to String
					name[j-1]=t;
					          ^
Main.java:45: error: variable i is already defined in method main(String[])
		for(int i=0;i<name.length;i++){
		        ^
8 errors
Language: Java

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

Compiler output:
Main.java:4: error: cannot find symbol
		string name[];
		^
  symbol:   class string
  location: class Main
Main.java:16: error: cannot find symbol
				string[0] = a;
				^
  symbol:   variable string
  location: class Main
Main.java:20: error: cannot find symbol
					if(string[k]==a){
					   ^
  symbol:   variable string
  location: class Main
Main.java:27: error: cannot find symbol
					string[listlen] = a;
					^
  symbol:   variable string
  location: class Main
Main.java:33: error: variable i is already defined in method main(String[])
		for(int i=0;i<num.length-1;i++){
		        ^
Main.java:39: error: cannot find symbol
					string s=name[j];
					^
  symbol:   class string
  location: class Main
Main.java:45: error: variable i is already defined in method main(String[])
		for(int i=0;i<name.length;i++){
		        ^
7 errors
Language: Java

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

Compiler output:
Main.java:4: error: cannot find symbol
		string[] name;
		^
  symbol:   class string
  location: class Main
Main.java:16: error: cannot find symbol
				string[0] = a;
				^
  symbol:   variable string
  location: class Main
Main.java:20: error: cannot find symbol
					if(string[k]==a){
					   ^
  symbol:   variable string
  location: class Main
Main.java:27: error: cannot find symbol
					string[listlen] = a;
					^
  symbol:   variable string
  location: class Main
Main.java:33: error: variable i is already defined in method main(String[])
		for(int i=0;i<num.length-1;i++){
		        ^
Main.java:39: error: cannot find symbol
					string s=name[j];
					^
  symbol:   class string
  location: class Main
Main.java:45: error: variable i is already defined in method main(String[])
		for(int i=0;i<name.length;i++){
		        ^
7 errors
Language: Java

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

Compiler output:
Main.java:14: error: ';' expected
			int listlen = name.length
			                         ^
Main.java:27: error: ';' expected
					string[listlen] = a:
					                   ^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {

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

sort(S.begin(), S.end()); //sort abcd...

A.at(0)=0;
for (int i=1; i<N; i++){
    if (S.at(i-1)==S.at(i)){
        A.at(i)=A.at(i-1)+1;
    } else {
        A.at(i)=0;
    }
}
int max=0;
for (int i=0; i<N; i++){
    if (A.at(i)>max){
        max=A.at(i);
    }
}
for (int i=0; i<N; i++){
    if (A.at(i)==max){
    cout << S.at(i) << endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

using namespace std;

int main(int argc, char *argv[])
{
  int N;
  cin >> N;
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }

  sort(S.begin(), S.end());
  vector<int> count(N);
  count.at(0) = 1;
  for (int i = 1; i < N; i++) {
    if (S.at(i) == S.at(i - 1)) {
      count.at(i) = count.at(i - 1) + 1;
    } else {
      count.at(i) = 1;
    }
  }
  int max_count = 0;
  for (int i = 0; i < N; i++) {
    max_count = max_count < count.at(i) ? count.at(i) : max_count;
  }
  for (int i = 0; i < N; i++) {
    if (count.at(i) == max_count) {
      cout << S.at(i) << endl;
    }
  }
  return 0;
}


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

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

int n;
int num[2000000];
vector<string>s;

int main(void){
    cin >> n;
    for(int i=0; i<n; i++){
        string tmp;
        cin >> tmp;
        s.push_back(tmp);
    }
    sort(s.begin(), s.end());

    int j=0;
    int maxvote=0;
    num[0]=1;
    for(int i=1; i<n; i++){
        if(s[i-1] != s[i]){
            j++;
        }
        num[j]++;
        if(maxvote < num[j]){
            maxvote = num[j];
        }
    }
    
    s.erase(unique(s.begin(), s.end()), s.end()); 

//            cout << "##" << endl;
//            cout << maxvote << endl;
//            cout << num[0] << endl;


    for(int i=0; i<s.size(); i++){
        if(num[i] == maxvote){
            cout << s[i] << 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
a.cc:31:13: error: 'unique' was not declared in this scope
   31 |     s.erase(unique(s.begin(), s.end()), s.end());
      |             ^~~~~~
Language: C++

#include<bits/stdc++.h>


using namespace std;
 
int main(){
  
 int N;
cin >> N;
vector<string> s(N);
map<string,int> str;
vector<string> t;
int max = 0;

for(int i = 0; i < N; i++){
    cin >> s[i];
    str[s[i]] += 1;
    if(max < str[s[i]]){ max = str[s[i]];}
}
vector<string> b;
int j = 0;
int count = 0;
for(int i = 0; i < N;i++){
    
    if(max == str[s[i]]){
        
        b[j] = s[i];
        j++;
        count = j;
        }
    }
}

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

for(int i = 0; i < count; i++){
    for(int k = 0; k < count; j++){
        if(b[i] != b[k] && i > k){
    cout << b[i] << endl;
        }
    }
}

return 0;





    
}


Compiler output:
a.cc:34:5: error: expected constructor, destructor, or type conversion before '(' token
   34 | sort(b.begin(),b.end());
      |     ^
a.cc:36:1: error: expected unqualified-id before 'for'
   36 | for(int i = 0; i < count; i++){
      | ^~~
a.cc:36:16: error: 'i' does not name a type
   36 | for(int i = 0; i < count; i++){
      |                ^
a.cc:36:27: error: 'i' does not name a type
   36 | for(int i = 0; i < count; i++){
      |                           ^
a.cc:44:1: error: expected unqualified-id before 'return'
   44 | return 0;
      | ^~~~~~
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

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

int main() {
  int n,count;
  count=0;
  cin>>n;
  vector<string>vec(n);
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    vec.at(i)=s;
  }
  sort(vec.begin(),vec.end());
  vector<int>a(n);
  vec.at(0)=0;
  for(int i=1;i<n;i++){
    if(vec.at(i-1)==vec.at(i))count++;
    else count=0;
    a.at(i)=count;
  }
  vector<int>b(n);
  for(int i=0;i<n;i++){
    b.at(i)=a.at(i);
  }
  sort(b.begin(),b.end());
  for(int i=0;i<n;i++){
    if(a.at(i)==b.at(n-1)){
      cout<<vec.at(i)<<endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: ambiguous overload for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   16 |   vec.at(0)=0;
      |             ^
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
Language: C++

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

static bool greater(const pair <int, int>&a, const pair <int, int>&b) {
	if (a.first < b.first) return false;
	if (a.first > b.first) return true;
	if (a.second < b.second) return true;
	return false;
}

int main(void) {
	int N;
	cin >> N;
	vector <string> S(N);
	for (int i = 0; i < N; i++) {
		cin >> S[i];
	}
	sort(S.begin(), S.end());

	vector <pair <int, int>> cont;
	int same_cnt = 0;
	string before = "";
	for (int i = 0; i < N; i++) {
		if (before != S[i]) {
			cont.push_back(make_pair(same_cnt, i-1));
			same_cnt = 0;
			before = S[i];
		}
		same_cnt++;
	}
	cont.push_back(make_pair(same_cnt, N-1));

	sort(cont.begin(), cont.end(), greater);
	int cnt_max = cont[0].first;

	for (int i = 0; i < cont.size(); i++) {
		if (cnt_max==cont[i].first) {
			cout << S[cont[i].second] << endl;
		} else {
			break;
		}
	}
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:40: error: reference to 'greater' is ambiguous
   36 |         sort(cont.begin(), cont.end(), greater);
      |                                        ^~~~~~~
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_function.h:353:12: note: candidates are: 'template<class _Tp> struct std::greater'
  353 |     struct greater;
      |            ^~~~~~~
a.cc:7:13: note:                 'bool greater(const std::pair<int, int>&, const std::pair<int, int>&)'
    7 | static bool greater(const pair <int, int>&a, const pair <int, int>&b) {
      |             ^~~~~~~
Language: C++

n = int(input())
mx = 1
d = {}
for i in range(n):
    s = input()
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1
    mx = max(mx, d[s])
spis = []
for k, z in d.items():
    if z == mx:
        spis.append(k)
spis.sort()
for a in spis:
    print(a)



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 i in range(n):
      | ^~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ld lond double
#define pll pair < long long , long long>
#define p_b push_back
#define all(x) x.begin(),x.end();
#define fi first
#define se second
using namespace std;

int main()
{
    int n;
    cin >> n;
    map < string , int > m;
    for( int i = 0; i < n; i++)
    {
        string s;
        cin >> s;
        m[s]++;
    }
    int mx= -1;
    for( auto it = m.begin(); it!=m.end(); it++)
    {
        mx = max(mx,it->second);
    }
    for( auto it = m.begin(); it!=m.end(); it++)
    {
        if(mx==it->second)
        {
            cout << it->fi<< endl;
        }
    }
}
#include <bits/stdc++.h>
#define ll long long
#define ld lond double
#define pll pair < long long , long long>
#define p_b push_back
#define all(x) x.begin(),x.end();
#define fi first
#define se second
using namespace std;

int main()
{
    int n;
    cin >> n;
    map < string , int > m;
    for( int i = 0; i < n; i++)
    {
        string s;
        cin >> s;
        m[s]++;
    }
    int mx= -1;
    for( auto it = m.begin(); it!=m.end(); it++)
    {
        mx = max(mx,it->second);
    }
    for( auto it = m.begin(); it!=m.end(); it++)
    {
        if(mx==it->second)
        {
            cout << it->fi<< endl;
        }
    }
}


Compiler output:
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main()
      |     ^~~~
a.cc:11:5: note: 'int main()' previously defined here
   11 | int main()
      |     ^~~~
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        Map<String, Integer> map = new TreeMap<String, Integer>();
        for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        }

        int min = 0;
        for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        }

        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        }

        Collections.sort(list);
        for (int i = 0 ; i < list.size() ; i++) {
            System.out.println(list.get(i));
        }


    }

Compiler output:
Main.java:46: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'itr' was not declared in this scope; did you mean 'it'?
   18 |       max=itr->second;
      |           ^~~
      |           it
Language: C++

from collections import defaultdict

n = int(input())
counts = defaultdict(int)

for _ in range(n):
    counts[input().strip()] += 1

vec = sorted([(-value, key) in counts.items()], reverse=True)
best = vec[0][0]
for v, s in vec:
    if v != best:
        break
    print(s)


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import defaultdict
      | ^~~~
Language: C++

N = int(input())
S = []
for i in range(N):
  S.append(input())

dict = {}
for i in range(N):
  if S[i] in dict:
    dict[S[i]] += 1
  else:
    dict[S[i]] = 1

m = 0
for k in dict:
  m = max(dict[k], m)

arr = []

for k in dict:
  if dict[k] == m:
    arr.append(k)

arr.sort()

for k in arr:
  print(k)

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

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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    string s;
    int mx = 0;
    vector<string> v;
    map<string, int> m;
    while (n--) {
        cin >> s;
        m[s]++;
        if (mx == m[s]) v.push_back(s);
        if (mx < m[s]) {
            mx = m[s];
            v = {s};
        }
    }
    sort(v.begin(), v.end());
    for (const auto & i : v) cout << i << "\n";
    return 0;
}


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

/*
   AUTHOR :- Gaurang_Kothiya
   
   Quote:-" Great things never come from comfort zones."                                                                                                                
*/
 
#include<bits/stdc++.h>
using namespace std;
 
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long  
#define ld long double
#define f(i,x,n) for(ll i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(ll i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define b_s(a,b)   binary_search( all(a),b)
#define lb(v,n)  lower_bound(all(v) ,n )
#define ub(v,n)  upper_bound( all(v) , n)
#define gcd(a,b) __gcd(a,b)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846
#define MOD 1000000007
 




void solve()
{
	ll n;
	cin>>n;
	
	m(string) s1;
	string s;
	
	f(i,0,n-1)
	{
		cin>>s;
		s1[s]++;
	}
	ll maxer=0;
	
	fe(x,s1)
	{
		maxer=max(maxer,x.S);
	}
	
	v(string) vec;
	fe(x,s1)
	{
		if(x.S == maxer) vec.pub(x.F);
	}
	
	fe(x,vec) cout<<x<<endl;
	
	
}

signed main() 
{
	speed;
	
	int q=1;
	//cin>>q;
	
	while(q--)
		solve();
		
 	//cout << "\n\n"<<"Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " seconds.\n";
	return 0;
}


Compiler output:
a.cc:53:17: error: macro "m" requires 2 arguments, but only 1 given
   53 |         m(string) s1;
      |                 ^
a.cc:33:9: note: macro "m" defined here
   33 | #define m(a,b) map<a,b>
      |         ^
a.cc: In function 'void solve()':
a.cc:53:9: error: 'm' was not declared in this scope
   53 |         m(string) s1;
      |         ^
a.cc:59:17: error: 's1' was not declared in this scope; did you mean 's'?
   59 |                 s1[s]++;
      |                 ^~
      |                 s
a.cc:63:14: error: 's1' was not declared in this scope; did you mean 's'?
   63 |         fe(x,s1)
      |              ^~
a.cc:14:32: note: in definition of macro 'fe'
   14 | #define fe(x,v)   for(auto &x :v)
      |                                ^
a.cc:69:14: error: 's1' was not declared in this scope; did you mean 's'?
   69 |         fe(x,s1)
      |              ^~
a.cc:14:32: note: in definition of macro 'fe'
   14 | #define fe(x,v)   for(auto &x :v)
      |                                ^
Language: C++


        mx = max(mx,mp[s[i]]);
    }
    for(auto k:mp){
        if(k.second==mx)
            ans.push_back(k.first);
    }
    sort(ans.begin(),ans.end());
    for(auto k:ans)
        cout<<k<<'\n';
}

Compiler output:
a.cc:2:9: error: 'mx' does not name a type
    2 |         mx = max(mx,mp[s[i]]);
      |         ^~
a.cc:3:5: error: expected declaration before '}' token
    3 |     }
      |     ^
a.cc:4:5: error: expected unqualified-id before 'for'
    4 |     for(auto k:mp){
      |     ^~~
a.cc:8:9: error: expected constructor, destructor, or type conversion before '(' token
    8 |     sort(ans.begin(),ans.end());
      |         ^
a.cc:9:5: error: expected unqualified-id before 'for'
    9 |     for(auto k:ans)
      |     ^~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

/*
   AUTHOR :- Gaurang_Kothiya
   
   Quote:-" Great things never come from comfort zones."                                                                                                                
*/
 
#include<bits/stdc++.h>
using namespace std;
 
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long  
#define ld long double
#define f(i,x,n) for(ll i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(ll i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define b_s(a,b)   binary_search( all(a),b)
#define lb(v,n)  lower_bound(all(v) ,n )
#define ub(v,n)  upper_bound( all(v) , n)
#define gcd(a,b) __gcd(a,b)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846
#define MOD 1000000007
 




void solve()
{
	ll n;
	cin>>n;
	
	m(String) s1;
	string s;
	
	f(i,0,n-1)
	{
		cin>>s;
		s1[s]++;
	}
	ll maxer=0;
	
	fe(x,s1)
	{
		maxer=max(maxer,x.S);
	}
	
	v(string) vec;
	fe(x,s1)
	{
		if(x.S == maxer) vec.pub(x.F);
	}
	
	fe(x,vec) cout<<x<<endl;
	
	
}

signed main() 
{
	speed;
	
	int q=1;
	//cin>>q;
	
	while(q--)
		solve();
		
 	//cout << "\n\n"<<"Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " seconds.\n";
	return 0;
}


Compiler output:
a.cc:53:17: error: macro "m" requires 2 arguments, but only 1 given
   53 |         m(String) s1;
      |                 ^
a.cc:33:9: note: macro "m" defined here
   33 | #define m(a,b) map<a,b>
      |         ^
a.cc: In function 'void solve()':
a.cc:53:9: error: 'm' was not declared in this scope
   53 |         m(String) s1;
      |         ^
a.cc:59:17: error: 's1' was not declared in this scope; did you mean 's'?
   59 |                 s1[s]++;
      |                 ^~
      |                 s
a.cc:63:14: error: 's1' was not declared in this scope; did you mean 's'?
   63 |         fe(x,s1)
      |              ^~
a.cc:14:32: note: in definition of macro 'fe'
   14 | #define fe(x,v)   for(auto &x :v)
      |                                ^
a.cc:69:14: error: 's1' was not declared in this scope; did you mean 's'?
   69 |         fe(x,s1)
      |              ^~
a.cc:14:32: note: in definition of macro 'fe'
   14 | #define fe(x,v)   for(auto &x :v)
      |                                ^
Language: C++

//organize , stay in moment and work -- Abhinav IIIT-A
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ar array
#define f(i,x,n) for(int i=x;i<n;++i)
#define sz(s) s.size()
#define pb push_back
void solve(){
    int a[3];
    f(i,0,3)
    cin>>a[i];
    sort(a,a+3);
    if((a[0]==a[1] || a[1] == a[2] )&& a[0]!=a[2] )
        cout<<"YES\n";
    else
        cout<<"NO\n";
}
void tp(){
    int n; cin>>n;
    bool tp=1;
    while(n--){
        int cp;
        cin>>cp;
        if(cp%2==0){
            if(!(cp%3==0 || cp%5==0))
                tp=0;
        }
    }
    tp ? cout<<"APPROVED" : cout<<"DENIED";
}
void q3(){
    int n;
    cin>>n;
    int mx=0;
    map<string ,int> mp;
    while(n--){
        string cp;
        cin>>cp;
        int xp=++mp[cp];
        mx=max(mx,xp);
    }
    for(auto ip : mp){
        if(ip->second==mx)
            cout<<ip->first<<"\n";
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;t=1;
    //cin>>t;
    while(t--)
    q3();
    return 0;
}


Compiler output:
a.cc: In function 'void q3()':
a.cc:44:14: error: base operand of '->' has non-pointer type 'std::pair<const std::__cxx11::basic_string<char>, long long int>'
   44 |         if(ip->second==mx)
      |              ^~
a.cc:45:21: error: base operand of '->' has non-pointer type 'std::pair<const std::__cxx11::basic_string<char>, long long int>'
   45 |             cout<<ip->first<<"\n";
      |                     ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define Rep(i,a,n) for (int i=a;i<=n;i++)
#define Per(i,a,n) for (int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

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

Compiler output:
a.cc: In function 'int main()':
a.cc:33:12: error: base operand of '->' has non-pointer type 'std::pair<const std::__cxx11::basic_string<char>, int>'
   33 |        if(i->second==mx){
      |            ^~
a.cc:34:19: error: base operand of '->' has non-pointer type 'std::pair<const std::__cxx11::basic_string<char>, int>'
   34 |            cout<<i->first<<endl;
      |                   ^~
Language: C++

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

using namespace std;
typedef long long ll;

int main() {
    int n;
    cin >> n;
    map<string, int> ma;
    int most = 0;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        if (ma.find(s) == ma.end())ma[s] = 0;
        ma[s]++;
        most = max(most, ma[s]);
    }

    vector<string> ret;
    for (auto x:ma) {
        if (x.second == most)ret.push_back(x.first);
    }
    sort(ret.begin(), ret.end());

    for (auto x:ret)cout << x << endl:
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:38: error: expected ';' before ':' token
   28 |     for (auto x:ret)cout << x << endl:
      |                                      ^
      |                                      ;
Language: C++

#include<bits/stdc++.h>
#include <atcoder/all>
#define ll long long int
#define rep(i,n) for(ll i=0;i<n;i++)
#define vec vector<ll>
#define mat vector<vector<ll>>

using namespace std;
using namespace atcoder;

const ll mod=1000000007;//998244353;
const ll inf=LONG_LONG_MAX;
ll dx4[4]={1,0,-1,0};
ll dy4[4]={0,-1,0,1};
ll dx8[8]={1,0,-1,1,-1,1,0,-1};
ll dy8[8]={1,1,1,0,0,-1,-1,-1};

int main(){

    ll n,k;
    cin >> n >> k;

    vec a,b,c;
    for(ll i=0;i<n;i++){
        ll x;
        cin >> x;
        if(x<0)a.emplace_back(-x);
        else if(x>0)c.emplace_back(x);
        else b.emplace_back(x);
    }

    sort(a.begin(),a.end());
    sort(c.begin(),c.end());

    ll x,y,z;
    x=a.size();
    y=b.size();
    z=c.size();

    if(x*z>=k){
        //k番目は負の数
        ll m=x*z;
        ll r=inf,l=0,h;
        while(abs(r-l)>1){
            h=(r+l)/2;
            ll s=0;
            for(ll i=0;i<x;i++){
                ll p=upper_bound(c.begin(),c.end(),h/a[i])-c.begin();
                s+=p;
            }
            if(s>=m-k+1)r=h;
            else l=h;
        }
        cout << -r << endl;
    }
    else if(x*z+y*(y-1)/2+y*(x+z)>=k){
        //k番目は0
        cout << 0 << endl;
    }
    else{
        //k番目は正
        ll m=x*z+y*(y-1)/2+y*(x+z);
        k-=m;
        ll r=inf,l=0,h;
        while(abs(r-l)>1){
            h=(r+l)/2;
            ll s=0,t=0;
            for(ll i=0;i<x;i++){
                ll p=upper_bound(a.begin(),a.end(),h/a[i])-a.begin();
                if(a[i]*a[i]<=h)p--;
                s+=p;
            }
            for(ll i=0;i<z;i++){
                ll p=upper_bound(c.begin(),c.end(),h/c[i])-c.begin();
                if(c[i]*c[i]<=h)p--;
                t+=p;
            }
            if(s/2+t/2>=k)r=h;
            else l=h;
        }
        cout << r << endl;
    }

  return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.