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

#include <bits/stdc++.h>

char str[110];
char tr[110];
int L;
int ans = 1000;

int main () {
	gets (str);
	L = int (strlen (str));
	for (char c = 'a'; c <= 'z'; ++c) {
		for (int i = 0; i < L; ++i)
			tr[i] = str[i];
		for (int i = 0; i < L; ++i) {
			for (int j = 0; j < L - i; ++j)
				if (c != tr[j]) goto con;
			if (ans > i) ans = i;
			break;
con:;
			for (int j = 0; j < L - 1 - i; ++j) {
				if (tr[j] == c || tr[j + 1] == c) tr[j] = c;
			}
		}
	}
	printf ("%d\n", ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |         gets (str);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
using namespace std;

int calc_max_part(const string& s, char target)
{
  int maxl = 0;
  for (size_t pos = 0, nextpos;; pos = nextpos + 1) {
    nextpos = s.find(target, pos);
    int l;
    if (nextpos == string::npos) {
      l = s.size() - pos;
    } else {
      l = nextpos - pos;
    }
    if (maxl < l) maxl = l;
    if (nextpos == string::npos) break;
  }
  return maxl;
}

int main(int argc, char *argv[])
{
  string s;
  cin >> s;
  int count[26] = {0};
  for (string::iterator c = s.begin(); c != s.end(); ++c) {
    count[*c - 'a']++;
  }

  int minl = INT_MAX;
  for (char target = 'a'; target <= 'z'; ++target) {
    if (count[target - 'a'] > 0) {
      int l = calc_max_part(s, target);
      minl = (minl < l)? minl : l;
    }
  }

  cout << minl << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:30:14: error: 'INT_MAX' was not declared in this scope
   30 |   int minl = INT_MAX;
      |              ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main (){
    string in;
    cin >> in;
    int ans = in.size();
    for(char c = 'a';c <= 'z';c++){
        string temp = in;
        if(temp.find(c) != string::npos){
            int prev = -1;
            int dist = 0;
            for(int i = 0;i < temp.size();i++){
                if(temp[i] == c){
                    dist = max(dist,i-prev+1);
                    prev = i;
                }
            }
            dist = max(dist,temp.size()-prev+1);
            ans = min(ans,dist);
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
   22 |             dist = max(dist,temp.size()-prev+1);
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:23: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   22 |             dist = max(dist,temp.size()-prev+1);
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:22:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   22 |             dist = max(dist,temp.size()-prev+1);
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <functional>
#include <map>
#include <ios>
#include <iosfwd>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <conio.h>
#include <numeric>
#include <list>
#include <windows.h>
#include <cfloat>
#include <climits>
using namespace std;

int ans=1e9;
string s;

inline bool finish(string cur)
{
	for(int i=1;i<cur.size();i++) if(cur[i]!=cur[i-1]) return 0;
	return 1;
}

inline int solve(string cur,char fin)
{
	if(finish(cur)) return (s.size()-cur.size());
	for(int i=1;i<cur.size();i++) if(cur[i]==fin) cur[i-1]=fin;
	cur=cur.substr(0,cur.size()-1);
	return solve(cur,fin);
}

int main()
{
	cin>>s;
	
	for(int i=1;i<s.size();i++) ans=min(ans,solve(s,s[i]));
	
	cout<<ans;
	
	return 0;
}

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

#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

char sir[110];

int main()
{
    //freopen("file.in","r",stdin);
    //freopen("file.out","w",stdout);
    gets(sir+1);
    int l=strlen(sir+1),sol=1e9;
    for(char i='a';i<='z';i++)
    {
        sir[l+1]=i;
        int c=0,r=0;
        for(int j=1;j<=l+1;j++)
            if(sir[j]==i) {r=max(r,c);c=0;}
            else c++;
        sol=min(sol,r);
    }
    printf("%d",sol);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   13 |     gets(sir+1);
      |     ^~~~
      |     getw
Language: C++

#include"vector"
#include"cmath"
#include"iostream"
#include"list"
#include"stack"
#include "queue"
#include"set"
#include "unordered_set"
#include "map"
#include"unordered_map"
#include"algorithm"
#include "cstring"
#include"string"
using namespace std;
#define all(v) v.begin(),v.end()
#define forn(n) for(auto i=n;i<n;++i)
typedef long long ll;
typedef long double ld;
string x;int n;
bool solv(int m)
{
    multiset<char>my;
    for(char ch='a';ch<='z';++ch)
    {
        my.clear();
        bool a=true;
        for(int i=0;i<m;++i)
        {
            my.insert(x[i]);
        }
        for(int i=m;i<n;++i)
        {
            if(my.find(ch)==my.end())
            {
                a=false;break;
            }
            my.erase(my.find(x[i-m]));
            my.insert(x[i]);
        }
        if(my.find(ch)==my.end())
        {
            a=false;
        }
        if(a)return true;
    }
    return false;
}
class TaskA {
public:
	void solve(std::istream& cin, std::ostream& cout) {
		ios_base::sync_with_stdio(false);
        cin>>x;
        n=x.length();
        int l=0,h=n,m;
        while(l<h-1)
        {
            m=(l+h)/2;
            if(solv(m))
            {
                h=m;
            }
            else
            {
                l=m;
            }
        }
        cout<<h-1<<'\n';
	}
};


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
#include <limits>


int main()
{
	int min = INT_MAX, nrMax = INT_MAX;
	std::string str;
	std::getline(std::cin, str);
	
	for (int i = 0; i < 26; ++i)
	{
		int nr = 0;
		bool flag = false, flag2 = true;
		
		for (int j = 0; j < str.length(); ++j)
			if (str[j] != 'a' + i)
				flag = true;
		
		for (int j = 0; j < str.length(); ++j)
			if (str[j] == 'a' + i)
				flag2 = false;
		
		if (flag2)
			continue;
		
		if (!flag)
		{
			std::cout << 0;
			return 0;
		}
		
		std::string str2 = str;
		
		while (flag)
		{
			bool flag3 = false;
			for (int j = 0; j < str.length() - nr; ++j)
			{
				if (str2[j] == 'a' + i && j != 0 && str2[std::max(j - 1, 0)] != 'a' + i)
				{
					str2[j - 1] = 'a' + i;
					flag3 = true;
				}
//				getch();
			}
			
			++nr;
			
			flag = false;
			for (int j = 0; j < str.length() - nr; ++j)
				if (str2[j] != 'a' + i)
					flag = true;
//			std::cout << str2 << " ";
			
		}
		
		if (nr < nrMax)
			nrMax = nr;
		
	}
	std::cout << nrMax;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'INT_MAX' was not declared in this scope
    8 |         int min = INT_MAX, nrMax = INT_MAX;
      |                   ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <limits>
  +++ |+#include <climits>
    4 | 
a.cc:59:26: error: 'nrMax' was not declared in this scope
   59 |                 if (nr < nrMax)
      |                          ^~~~~
a.cc:63:22: error: 'nrMax' was not declared in this scope
   63 |         std::cout << nrMax;
      |                      ^~~~~
Language: C++

#include <iostream>
#include <string>
#include <limits>
#include <conio.h>

int main()
{
	int min = INT_MAX, nrMax = INT_MAX;
	std::string str;
	std::getline(std::cin, str);
	
	for (int i = 0; i < 26; ++i)
	{
		int nr = 0;
		bool flag = false, flag2 = true;
		
		for (int j = 0; j < str.length(); ++j)
			if (str[j] != 'a' + i)
				flag = true;
		
		for (int j = 0; j < str.length(); ++j)
			if (str[j] == 'a' + i)
				flag2 = false;
		
		if (flag2)
			continue;
		
		if (!flag)
		{
			std::cout << 0;
			return 0;
		}
		
		std::string str2 = str;
		
		while (flag)
		{
			bool flag3 = false;
			for (int j = 0; j < str.length() - nr; ++j)
			{
				if (str2[j] == 'a' + i && j != 0 && str2[std::max(j - 1, 0)] != 'a' + i)
				{
					str2[j - 1] = 'a' + i;
					flag3 = true;
				}
//				getch();
			}
			
			++nr;
			
			flag = false;
			for (int j = 0; j < str.length() - nr; ++j)
				if (str2[j] != 'a' + i)
					flag = true;
//			std::cout << str2 << " ";
			
		}
		
		if (nr < nrMax)
			nrMax = nr;
		
	}
	std::cout << nrMax;
}

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

#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>


using namespace std;


int main(void)
{
	vector<char> s(100+2);

	while(scanf("%100[a-z]\n", &s[0])==1)
	{
		int l=strlen(&s[0]);
		vector<char> t(l+1), t_(l+1);
		int c, ans;

		ans=l;
		for(int i=0;i<l;i++)
		{
			if(s[i]!=s[0]) break;
		}
		if(i==l) ans=0;

		t=s;
		for(int i=0;i<l;i++)
		{
			int x=s[i];
			t_=s;
			for(int l_=l;l_>1;l_--)
			{
				c=0;
				t=t_;
				for(int j=0;j<l_-1;j++)
				{
					if(t[j]==x)
					{
						t_[j]=x;
						c++;
					}
					else if(t[j+1]==x)
					{
						t_[j]=x;
						c++;
					}
					else
					{
						t_[j]=t[j];
					}
				}
				t[l_-1]='\0';
				if(c>=l_-1)
				{
					ans=min(ans, l-l_+1);
					break;
				}
			}
		}
		printf("%d\n", ans);
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'i' was not declared in this scope
   25 |                 if(i==l) ans=0;
      |                    ^
Language: C++

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

int main(){
	string s;
	cin>>s;
	
	int b;
	int c;
	int m=0;
	int ans=101;
	
	
	for(int i=-0;i<s.size();i++){
		mp[s[i]]++;
	}
	
	int bb=0;
	for(auto &el:mp){
		if(bb<el.second){
			bb=el.second;
		}
	}
	if(bb<2){
		cout<<bb<<endl;
		return 0;
	}
	
	for(int i=0;i<s.size();i++){
		char x=s[i];
		b=0;
		c=0;
		int j;
		for(j=0;j<s.size();j++){
			if(b=0&&s[j]==x){
				b=j;
			}else if(s[j]==x){
				c=j;
				m=max(m,c-b-1);
				b=c;
			}
		}
		ans=min(ans,m);
	}
	int ansa=m/3;
	if(m%3!=0)ansa++;
	cout<<ansa<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'mp' was not declared in this scope; did you mean 'm'?
   17 |                 mp[s[i]]++;
      |                 ^~
      |                 m
a.cc:21:22: error: 'mp' was not declared in this scope; did you mean 'm'?
   21 |         for(auto &el:mp){
      |                      ^~
      |                      m
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
static const int INF = 1ll<<60;
typedef pair<int,int> P1;
typedef pair<int,pair<int,int> > P2;

string s;
int ans = INF;
vector<int> v[26];

signed main(){
    cin>>s;
    for(int i=0;i<s.size();++i)v[s[i]-'a'].PB(i + 1);
    for(int i = 0;i<26;++i){
        if(v[i].size()){
            int res = 0;
            for(int j=0;j<v[i].size();++j){
                int length;
                if(j == 0)length = v[i][j] - 1;
                else length = v[i][j] - v[i][j-1] - 1;
                res = max(res,length);
            }
            res = max(res,s.size()-v[i][v[i].size() -1]);
            ans = min(ans,res);
        }
    }
    cout<<ans<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: no matching function for call to 'max(long long int&, long long unsigned int)'
   28 |             res = max(res,s.size()-v[i][v[i].size() -1]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:28:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   28 |             res = max(res,s.size()-v[i][v[i].size() -1]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:28:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |             res = max(res,s.size()-v[i][v[i].size() -1]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

#define long long ll;

bool checkStr(const string &str, const char c) {
  for (int i=0; i<(int)str.length(); i++) {
    if (c != str[i]) return false;
  }
  return true;
}

void replaceChar(string &str, const char c) {
  string t="";
  for (int i=0; i<(int)str.length()-1; i++) {
    if (str[i] == c || str[i+1] == c) {
      t += c;
    } else {
      t += str[i];
    }
  }
  str = t;
}

int main() {
  string s;
  cin >> s;

  int min=100;
  for (int i=0; i<(int)s.length(); i++) {
    int ans=0;
    string tmp = s;
    while(!checkStr(tmp, s[i])) {
      //cout << tmp << endl;
      replaceChar(tmp, s[i]);
      ans++;
    }
    min = (min>ans)?ans:min;
  }

  cout << min << endl;
  return 0;
}


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

#include<stdio.h>
#include<string.h>
struct{
	char c;
	int time[100],max,k;
}temp[30];
int main ()
{
	int i;
	
	char s[105];
	while(gets(s)){for(i=0;i<26;i++){
		temp[i].c='a'+i;
		temp[i].time[0]=0;
		temp[i].max=0;
		temp[i].k=1;
	}
		int len=0,j;
		len=strlen(s);
		for(i=0;i<len;i++)
			for(j=0;j<26;j++){
				if(s[i]==temp[j].c){
				temp[j].time[temp[j].k]=i+1;
				temp[j].k++;
				break;	
				}
			}
		for(i=0;i<26;i++)
			temp[i].time[temp[i].k]=len+1;
		for(i=0;i<26;i++)
			for(j=1;j<=temp[i].k;j++){
				if(temp[i].max<(temp[i].time[j]-temp[i].time[j-1]))
					temp[i].max=temp[i].time[j]-temp[i].time[j-1];
			}
		int answer;
		answer=temp[0].max;
		for(i=0;i<26;i++)
			if(answer>temp[i].max)
			answer=	temp[i].max;
		printf("%d\n",answer-1);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |         while(gets(s)){for(i=0;i<26;i++){
      |               ^~~~
      |               getw
Language: C++

#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
#include<cstdlib>5
#include<string>
#include<algorithm>
#define LL long long
#define INF 1000000009
using namespace std;
int main()
{
   char s[1000];
   int vis[30];
  for(int i=0;i<29;i++)
  vis[i]=INF;
   gets(s);
   int len=strlen(s);
   int ans=len/2;
   //printf("%d\n",ans);
   for(int i=0;i<26;i++)
   {
       int a=-1;
       for(int j=0;j<len;j++)
       {
           if(s[j]-'a'==i||j==len-1)
           {
               int b=0;
               if(j==len-1&&s[j]-'a'!=i)
               b=1;
               if(vis[i]==INF)
               vis[i]=j-a-1+b;
               else
               vis[i]=max(vis[i],j-a-1+b);
               a=j;
              // printf("vis[%c]=%d\n",i+'a',vis[i]);
           }
       }
   }
   for(int i=0;i<26;i++)
   {
       ans=min(ans,vis[i]);
   }
   printf("%d\n",ans);
}

Compiler output:
a.cc:7:18: warning: extra tokens at end of #include directive
    7 | #include<cstdlib>5
      |                  ^
a.cc: In function 'int main()':
a.cc:19:4: error: 'gets' was not declared in this scope; did you mean 'getw'?
   19 |    gets(s);
      |    ^~~~
      |    getw
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cassert>
#include <complex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <ctime>
#include <cctype>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <deque>
#include <stack>
#include <memory.h>
#include <_mingw.h>
using namespace std;
#define ll long long 
int use[26];
bool p[26];
string s;
bool check(string d){
	char o=d[0];
	for(int i=0;i<d.size();i++){
		if(d[i]!=o){
			return 0;
		}
	}
	return 1;
}
int main()
{
	cin>>s;
	for(int i=0;i<s.size();i++){
		use[s[i]-'a']++;
	}
	int mx=-999,maxd=0,maxh=0;
	for(int i=0;i<26;i++){
		if(max(mx,use[i])==use[i]){
			mx=use[i];
			maxd=i;
			//cout<<maxd<<" ";
		}
	} 
	p[maxd]=1;
	char mai=maxd+'a';
	/*for(int i=0;i<26;i++){
		cout<<use[i]<<" ";
	}*/
	//cout<<mai<<" ";
	if(s[0]==mai){
		for(int i=0;i<26;i++){
			if(max(mx,use[i])==use[i]){
				maxd=i;
				break;
			}
		}
	}
	mai=maxd+'a';
	int cnt=0;
	while(!check(s)){
		bool ok=0;
		bool ok1=0;
		cnt++;
		for(int i=1;i<s.size()-1;i++){
			if(s[i]!=mai&&s[i+1]!=mai&&s[i-1]!=mai){
				s.erase(i,1);
				ok=1;
				break;
			}
		}
		if(!ok){
			for(int i=1;i<s.size()-1;i++){
				if(s[i]!=mai){
					s.erase(i,1);
					ok1=1;
					break;
				}
			}
		}
		if(!ok1){
			if(s[0]==mai){
				s.erase(s.size()-1,1);
			}
			else s.erase(0,1);
		}
		for(int i=0;i<s.size();i++){
			if(s[i+1]==mai){
				s[i]=mai;
			}
		}
	}
	cout<<cnt;
    return 0;
}

Compiler output:
a.cc:24:10: fatal error: _mingw.h: No such file or directory
   24 | #include <_mingw.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

/**
 * Created by yoshiwaratomohiro on 2017/06/18.
 */
import java.util.Scanner;
public class Agc16A {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        int[] snum = new int[s.length()];
        for(int i=0;i<s.length();i++){
            snum[i]=s.charAt(i)-'a';
        }

        int min=10000;
        for(int i=0;i<26;i++){
            int[] ans = new int[s.length()];
            for(int j=0;j<s.length();j++){
                ans[j]=i;
            }

            int s_[] = new int[s.length()];
            for(int j=0;j<s.length();j++){
                s_[j]=snum[j];
            }


 inside:           for(int j=0;j<s.length();j++){
                for(int k=0;k<s_.length;k++){
                    if(s_[k]!=i){
                        break;
                    }
                    if(k==s_.length-1){
                        min=Math.min(min,j);
                        break inside;
                    }
                }


                    int[] conv=new int[s.length()-j-1];

                for(int k=1;k<s.length()-j;k++){
                    if(s_[k-1]==i||s_[k]==i){
                        conv[k-1]=i;
                    }else{
                        conv[k-1]=s_[k-1];
                    }
                }
                s_=new int[s.length()-j-1];
                for(int k=0;k<s.length()-j-1;k++){
                    s_[k]=conv[k];
                }
            }
        }
        System.out.println(min);
    }
}


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

/**
 * Created by yoshiwaratomohiro on 2017/06/18.
 */
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        int[] snum = new int[s.length()];
        for(int i=0;i<s.length();i++){
            snum[i]=s.charAt(i)-'a';
        }

        int min=10000;
        for(int i=0;i<26;i++){
            int[] ans = new int[s.length()];
            for(int j=0;j<s.length();j++){
                ans[j]=i;
            }

            int s_[] = new int[s.length()];
            for(int j=0;j<s.length();j++){
                s_[j]=snum[j];
            }


 inside:           for(int j=0;j<s.length();j++){
                for(int k=0;k<s_.length;k++){
                    if(s_[k]!=i){
                        break;
                    }
                    if(k==s_.length-1){
                        min=Math.min(min,j);
                        break inside;
                    }
                }


                    int[] conv=new int[s.length()-j-1];

                for(int k=1;k<s.length()-j;k++){
                    if(s_[k-1]==i||s_[k]==i){
                        conv[k-1]=i;
                    }else{
                        conv[k-1]=s_[k-1];
                    }
                }
                s_=new int[s.length()-j-1];
                for(int k=0;k<s.length()-j-1;k++){
                    s_[k]=conv[k];
                }
            }
        }
        System.out.println(min);
    }
}


Compiler output:
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Scanner;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
using namespace std;

/* sample input

*/
int n;
string str;

int main()
{
	cin >> str;
	int len = str.length();

	int count = 0;
	int answer = INT_MAX;
	for (int i = 0; i < 26; i++){
		count = 0;
		int tmax = 0;
		for (int j = 0; j < len; j++){
			if (str[j] != char('a' + i)){
				count++;
				tmax = max(tmax, count);
			}
			else{
				count = 0;
			}
		}
		answer = min(tmax, answer);
	}

	cout << answer;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: 'INT_MAX' was not declared in this scope
   22 |         int answer = INT_MAX;
      |                      ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <queue>
  +++ |+#include <climits>
    7 | #include <string>
Language: C++

import org.omg.CORBA.MARSHAL;

import java.util.*;

public class Main {
    //-------------------------------------------------------------//
    public static final void main(String[] args) {
        new Main().solve();
    }
    //-------------------------------------------------------------//
    private final Scanner sc = new Scanner(System.in);

    void solve() {
        char[] s = sc.next().toCharArray();
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < s.length; i++) {
            set.add(s[i]);
        }

        int ans = Integer.MAX_VALUE;
        for (char c = 'a'; c <= 'z'; c++) {
            if (set.contains(c)) {
                int count = 0;
                int maxCount = 0;
                for (int i = 0; i < s.length; i++) {
                    if (s[i] != c) count++;
                    if (s[i] == c) {
                        maxCount = Math.max(maxCount, count);
                        count = 0;
                    }
                }
                maxCount = Math.max(maxCount, count);
                ans = Math.min(ans, maxCount);
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import org.omg.CORBA.MARSHAL;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

#include<bist/stdc++.h>
using namespace std;
int a[29];
int main()
{
int c=0,i;
    string s;
     cin>>s;
     for(i=0;i<s.length();i++)
    {
        if(a[s[i]-'a']!=1)
{  
a[s[i]-'a']==1;
c++;
}
}
cout<<c/2<<endl;

Compiler output:
a.cc:1:9: fatal error: bist/stdc++.h: No such file or directory
    1 | #include<bist/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import org.omg.PortableServer.POA;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class Stress {


    BufferedReader br;
    StringTokenizer sc;
    PrintWriter out;

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new Stress().run();
    }

    void run() throws IOException {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
//            br = new BufferedReader(new FileReader("field.in"));
//            out = new PrintWriter(new File("field.out"));
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    String nextToken() throws IOException {
        while (sc == null || !sc.hasMoreTokens()) {
            try {
                sc = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return sc.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }


    void solve() throws IOException {
        char c[] = nextToken().toCharArray();
        int n = c.length;
        int gMax = Integer.MAX_VALUE;
        for (int i = 0; i < 26; i++) {
            int max = 0;
            int cnt = 0;
            for (int j = 0; j < n; j++) {
                if(c[j] - 'a' != i){
                    cnt++;
                }else{
                    max = Math.max(max, cnt);
                    cnt = 0;
                }
            }
            if(cnt <= max){
                gMax = Math.min(gMax, max);
            }
        }
        out.print(gMax);
    }
}

Compiler output:
Main.java:8: error: class Stress is public, should be declared in a file named Stress.java
public class Stress {
       ^
Main.java:1: error: package org.omg.PortableServer does not exist
import org.omg.PortableServer.POA;
                             ^
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;


public class Solution {

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }
}

class Task {


    public void solve(InputReader in, PrintWriter out) {
        String str = in.next();
        int ans = Integer.MAX_VALUE;
        for (char ch : str.toCharArray()) {
            String s = str;
            int cnt = 0;
            while (true) {
                boolean go = false;
                for (int i = 0; i < s.length(); i++)
                    if (s.charAt(i) != ch) {
                        go = true;
                        break;
                    }
                if (!go) break;
                cnt++;
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < s.length() - 1; i++) {
                    if (s.charAt(i) == ch || s.charAt(i + 1) == ch) {
                        sb.append(ch);
                    } else {
                        sb.append(s.charAt(i));
                    }
                }
                s = sb.toString();
            }
            ans = Math.min(ans, cnt);
        }
        out.println(ans);
    }


}


class InputReader {

    private final BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

}


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

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;

public class main {
    public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    public static PrintWriter pw = new PrintWriter(System.out);
    public static String line;
    public static StringTokenizer st;
    public static ArrayList<ArrayList<Integer>> adjList;
    public static int[] dx = {-1, 0, 1, 0, -1, 1, 1, -1};
    public static int[] dy = {0, 1, 0, -1, 1, 1, -1, -1};
    public static int INF = 0x3f3f3f3f;
    public static long LINF = 0x3f3f3f3f3f3f3f3fL;
    public static int MOD = 1000000007;

    public static void main(String[] args) throws Exception{
        String s = br.readLine();
        TreeSet<Character> d = new TreeSet<Character>();
        for(int i = 0; i < s.length(); i++){
            d.add(s.charAt(i));
        }

        int best = INF;
        if(d.size() == 1){
            best = 0;
        }
        for(Character t : d){
            boolean f = true;
            char[] A = s.toCharArray();
            int ans = 0;
            while(f){
                f = false;
                char[] B = new char[A.length-1];
                for(int i = 0; i < B.length; i++){
                    if(A[i] == t || A[i+1] == t){
                        B[i] = t;
                    } else{
                        B[i] = A[i];
                        f = true;
                    }
                }
                ans++;
                A = B;
            }
            best = Math.min(best, ans);
        }
        pw.print(best + "\n");
        
        pw.close(); 
        br.close();
    }
}

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

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
  string s;
  cin>>s;
  ll n = s.sz;
  ll mn = 10000000;
  rep(i,0,26){
    char c = 'a'+i;
    string s1 = s;
    ll e = 0;
    rep(j,0,n-1){
      ll flag = 1;
      rep(k,0,s1.sz){
        if(s1[k]!=c)flag = 0;
      }
      if(flag == 1){
        mn = min(mn,e);
        break;
      }
      string s2;
      rep(k,0,s1.sz-1){
        if(s1[k]==c||s1[k+1]==c){
          s2 += ctos(c);
        }
        else{
          s2 += "+";
        }
      }
      s1 = s2;
      e++;
    }
  }
  cout << mn << endl;
  return 0;
}#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
  string s;
  cin>>s;
  ll n = s.sz;
  ll mn = 10000000;
  rep(i,0,26){
    char c = 'a'+i;
    string s1 = s;
    ll e = 0;
    rep(j,0,n-1){
      ll flag = 1;
      rep(k,0,s1.sz){
        if(s1[k]!=c)flag = 0;
      }
      if(flag == 1){
        mn = min(mn,e);
        break;
      }
      string s2;
      rep(k,0,s1.sz-1){
        if(s1[k]==c||s1[k+1]==c){
          s2 += ctos(c);
        }
        else{
          s2 += "+";
        }
      }
      s1 = s2;
      e++;
    }
  }
  cout << mn << endl;
  return 0;
}

Compiler output:
a.cc:73:2: error: stray '#' in program
   73 | }#include <algorithm>
      |  ^
a.cc:73:3: error: 'include' does not name a type
   73 | }#include <algorithm>
      |   ^~~~~~~
a.cc:112:5: error: redefinition of 'int main()'
  112 | int main() {
      |     ^~~~
a.cc:40:5: note: 'int main()' previously defined here
   40 | int main() {
      |     ^~~~
Language: C++

using namespace std;
#define fo(i,a,b) for(int i=(a);i<(b);i++)
#define MP make_pair
#define PB push_back
#define SZ(a) ((int)a.size())
typedef long long ll;

int mn = 110;
string s;

int main () {
	cin >> s;
	for (char i = 'a'; i <= 'z'; i++) {
		int mx = 0, l = 0;
		for (int j = 0; j < SZ(s); j++) {
			if (s[j] == i) {
				mx = max(mx, j-l);
				l = j+1;
			}
		}
		mx = max(mx, SZ(s)-l);
		mn = min(mn, mx);
		//printf("%c %d\n", i, mx);
	}
	printf("%d\n", mn);
	return 0;
}

Compiler output:
a.cc:9:1: error: 'string' does not name a type
    9 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin >> s;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:12:16: error: 's' was not declared in this scope
   12 |         cin >> s;
      |                ^
a.cc:17:38: error: 'max' was not declared in this scope; did you mean 'mx'?
   17 |                                 mx = max(mx, j-l);
      |                                      ^~~
      |                                      mx
a.cc:21:22: error: 'max' was not declared in this scope; did you mean 'mx'?
   21 |                 mx = max(mx, SZ(s)-l);
      |                      ^~~
      |                      mx
a.cc:22:22: error: 'min' was not declared in this scope; did you mean 'mn'?
   22 |                 mn = min(mn, mx);
      |                      ^~~
      |                      mn
a.cc:25:9: error: 'printf' was not declared in this scope
   25 |         printf("%d\n", mn);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    int n; cin >> n;
    vint a(n);
    rep(i,n) cin >> a[i];
    bool ans = false;
    int mx = *max_element(all(a));
    int mn = *min_element(all(a));
    if (mx - mn == 1) {
        int ct_mx = 0, ct_mn = 0;
        rep(i,n) {
            if (a[i] == mx) ct_mx++;
            else ct_mn++;
        }
        if (ct_mn <= k && n + ct_mn >= 2 * mx) ans = true;
    }
    if (mx - mn == 0) {
        if (mx + 1 == n || n >= 2 * mx) ans = true;
    }
    if (ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:22: error: 'k' was not declared in this scope
   36 |         if (ct_mn <= k && n + ct_mn >= 2 * mx) ans = true;
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++){
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  if (a[N - 1] - a[0] > 1){
    cout << "No" << endl;
  } else if (a[0] == a[N - 1]){
    if (a[0] * 2 <= N || a[0] == N - 1){
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    if (a[0] == a[a[0]]){
      cout << "No" << endl;
    } else if (a[N - 2] != a[N - 1]{
      cout << "No" << endl;
    } else {
      assert(false);
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:36: error: expected ')' before '{' token
   22 |     } else if (a[N - 2] != a[N - 1]{
      |               ~                    ^
      |                                    )
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define double long double
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Graph=vector<vector<int>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  int N;
  cin>>N;
  vectro<int> L;
  REP(i,N){
    int a;
    cin>>a;
    L.PB(a);
  }
  SORT(L);
  
  bool CAN=true;
  
  if(L.at(N-1)==L.at(0)){
    if(L.at(0)!=N-1) CAN=false;
  }
  else if(L.at(N-1)==L.at(0)+1){
    if(L.at(N-2)==L.at(0)) CAN=false;
  }
  else CAN=false;
  
  if(CAN) COYe;
  else CONo;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:3: error: 'vectro' was not declared in this scope
   72 |   vectro<int> L;
      |   ^~~~~~
a.cc:72:10: error: expected primary-expression before 'int'
   72 |   vectro<int> L;
      |          ^~~
a.cc:76:5: error: 'L' was not declared in this scope
   76 |     L.PB(a);
      |     ^
a.cc:78:8: error: 'L' was not declared in this scope
   78 |   SORT(L);
      |        ^
a.cc:46:23: note: in definition of macro 'SORT'
   46 | #define SORT(V) sort((V).begin(),(V).end())
      |                       ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;


signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;
	int A[N];
	bool ok = true;
	rep(i,N){
		cin >> A[i];
	}
	sort(A, A+N);
	if(N == 2){
		rep(i,N){
			if(A[i] != 1){
				ok = false;
			}
		}
	}
	else if(N == 3){
		for(int i=1;i<N;i++){
			if(A[i] != 2){
				ok = false;
			}
		}
	}
	else{
		if(A[0] == A[N-1]){
			if(A[0] == N-1){
				cout << "Yes" << endl;
				return 0;
			}
			else if(N/A[0] == 1){
				cout << "No" << endl;
				return 0;
			}
			else{
				cout << "Yes" << endl;
				return 0;
			}
		}
		else{
			if(A[N-1] - A[0] >= 2){
				cout << "No" << endl;
				reutrn 0;
			}
			for(int i=1;i<N;i++){
				if(A[i] != A[i-1]){
					if(i == A[i-1]){
						cout << "Yes" << endl;
						return 0;
					}
					else{
						cout << "No" << endl;
						return 0;
					}
				}
			}
		}
	}
	cout << (ok ? "Yes" : "No") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:33: error: 'reutrn' was not declared in this scope
   55 |                                 reutrn 0;
      |                                 ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
#define rep3(i,n,m) for(long long i=n;i>=m;i--)
using namespace std;
using ll = long long;
using P = pair<int,int>;
using graph= vector<vector<int>>; 
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main(){
 ll n;
 cin >> n ;
 vector<ll> A(n) ;
 rep(i,n) cin>> A[i] ;
 sort(A.begimn(),A.end()) ;
 int sakai=0 ;
 int ans=0 ;
 if(A[0]==A[n-1]){
   if(A[0]==n-1||A[0]*2<=n)
   ans=1 ;
 }

if(A[0]+1==A[n-1]){
 rep(i,n-1){
   if(A[i]!=A[i+1]){
     sakai =i+1 ;
     break ;
   }
} 
    if(sakai+(n-sakai)*2<=n)
    ans =1 ;
}
   if(ans=1)
   cout <<"Yes"<<endl ;
   else 
    cout <<"No"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'class std::vector<long long int>' has no member named 'begimn'; did you mean 'begin'?
   19 |  sort(A.begimn(),A.end()) ;
      |         ^~~~~~
      |         begin
Language: C++


#include <iostream>

using namespace std;

int main()
{
    cout<<"Hello World";
    cin >> n;
    int Arr[2][n], Sum = 0, flag = 0, temp = 0;
    for(int i = 0; i < n; i++){
        cin >> A[0][i];
        Sum += A[0][i];
    }
    
    
    for(int i = 0; i < n; i++){
        if(!flag){
            if(int((Sum - A[0][i])/(n - 1)) >= A[0][i])
                flag = 1;
        }
    }
    
    if(flag == 1)
        cout << "Yes";
    else 
        cout << "No";

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'n' was not declared in this scope
    9 |     cin >> n;
      |            ^
a.cc:12:16: error: 'A' was not declared in this scope
   12 |         cin >> A[0][i];
      |                ^
a.cc:19:27: error: 'A' was not declared in this scope
   19 |             if(int((Sum - A[0][i])/(n - 1)) >= A[0][i])
      |                           ^