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

#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  set<char> chars;
  for(int i=0;i<S.length();i++){
    chars.insert(S[i]))
  }
  if(chars.size()==1){
    cout << 0 << endl;
  }
  
  int res=100,times;
  for(auto key=chars.begin();key!=chars.end();key++){
    string str = S;
    bool flag = true;
    times = 1;
    while (flag) {
      string vacant;
      flag = false;
      for (ll i = 0; i < str.length()-1; ++i) {
        if (str[i] == *key || str[i+1] == *key) {
          vacant += *key;
        }
        else{
          vacant += str[i];
          flag = true;
        }
      }
      if(flag){
        str = vacant;
        times++;
      }
    }
    res = min(res,times);
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected ';' before ')' token
    7 |     chars.insert(S[i]))
      |                       ^
      |                       ;
a.cc:21:12: error: 'll' was not declared in this scope
   21 |       for (ll i = 0; i < str.length()-1; ++i) {
      |            ^~
a.cc:21:22: error: 'i' was not declared in this scope
   21 |       for (ll i = 0; i < str.length()-1; ++i) {
      |                      ^
Language: C

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

typedef struct {
	int flag;
	int cost;
}moji_t;

int main(void) {
	char s[110] = { 0 };
	int len;
	moji_t moji[26] = { 0 };

	scanf("%s", s);
	len = strlen(s);
	for (int i = 0; i < len; i++) moji[s[i] - 97].flag = 1;

	for (int i = 0; i < 26; i++) {
		int left = -1,temp=-1;
		if (moji[i].flag) {
			for (int j = 0; j < len; j++) {
				if (j == 0 && s[j] == i - 97)left = 0;
				else if (s[j] == i+97) {
					temp = j - left - 1;
					if(temp>moji[i].cost) moji[i].cost = temp;
					left = j;
				}
				else if (j == len - 1) {
					temp= len - 1 - left;
					if (temp > moji[i].cost) moji[i].cost = temp;
					left = j;
				}
			}
		}
	}
	int min = INT_MAX;
	for (int i = 0; i < 26; i++) {
		if (moji[i].flag&&min > moji[i].cost)min = moji[i].cost;
	}
	printf("%d",min);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:15: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   15 |         len = strlen(s);
      |               ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strlen'
    2 | #include <stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:15:15: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   15 |         len = strlen(s);
      |               ^~~~~~
main.c:15:15: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:36:19: error: 'INT_MAX' undeclared (first use in this function)
   36 |         int min = INT_MAX;
      |                   ^~~~~~~
main.c:3:1: note: 'INT_MAX' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>'
    2 | #include <stdlib.h>
  +++ |+#include <limits.h>
    3 | 
main.c:36:19: note: each undeclared identifier is reported only once for each function it appears in
   36 |         int min = INT_MAX;
      |                   ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define REP(i,n) for(int i=(0);i<(n);i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

template<class T> inline void read(T &x){
	int f=0;x=0;char ch=getchar();
	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');
	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';
	if(f)x=-x;
}

int ans[505][505],H,W,h,w;
ll sum;

int main(){
	read(H),read(W);
	read(h),read(w);
	rep(i,1,H){
		rep(j,1,W){
			int a=min(i,H+1-i),b=min(j,W+1-j);
			ans[i][j]=(a%h==0&&b%w==0||i==h&&j==w?-h*w:1);
			sum+=ans[i][j];
		}
	}
	if(sum<=0) puts("No");
	else{
		puts("Yes");
		rep(i,1,n){
			rep(j,1,m) printf("%d ",ans[i][j]);
			puts("");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:25: error: 'n' was not declared in this scope
   37 |                 rep(i,1,n){
      |                         ^
a.cc:2:38: note: in definition of macro 'rep'
    2 | #define rep(i,a,b) for(int i=(a);i<=(b);i++)
      |                                      ^
a.cc:38:33: error: 'm' was not declared in this scope
   38 |                         rep(j,1,m) printf("%d ",ans[i][j]);
      |                                 ^
a.cc:2:38: note: in definition of macro 'rep'
    2 | #define rep(i,a,b) for(int i=(a);i<=(b);i++)
      |                                      ^
Language: C++

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s = read().decode().rstrip()

ans = len(s)


for i in range(97, 97+26):
    c = chr(i)
    cnt = 0
    acc = s
    while len(acc) != acc.count(c):
        s_ = ""
        for j, _ in enumerate(acc):
            if j == len(acc)-1:
                break
            if acc[j:j+2].count(c) > 0:
                s_ += c
            else:
                s_ += acc[j]
        cnt += 1
        acc = s_
    ans = min(ans, cnt)

print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main() {
  string s;
  cin >> s;
  int alp[26]={};
  rep(i,s.size()){
    alp[s[i]-'a']++;
  }
  int M=0;
  char c=s[s.size()/2];
  rep(i,26){
    if(M<alp[i]){
      c=char('a'+i);
      M=alp[i];
    }
  }
  vector<char>word;
  word.push_back(c);
  rep(i,26){
    if(alp[i]==M) word.push_back('a'+i);
  }
  int now=0;
  vector<int>num;
  rep(i,s.size()){
    if(s[i]==word[j]){
      num.push_back(now);
      now=0;
    }
    else now++;
  }
  sort(num.begin(),num.end());
  cout << max(now-1,num[num.size()-1]) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: 'j' was not declared in this scope
   30 |     if(s[i]==word[j]){
      |                   ^
Language: Java

// serval
// srrva
// rrrv
// rrr

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Map<Character, List<Integer>> map = new HashMap<>();
    for (int i = 0; i < S.length(); i++) {
      char c = S.charAt(i);
      List<Integer> list = map.get(c);
      if (list == null) {
        list = new ArrayList();
        map.put(c, list);
      }
      list.add(i);
    }
    
    int ans = 1000;
    for (List<Integer> list : map.values()) {
      int diffMax = 0;
      int prev = -1;
      for (int idx : list) {
        int diff = prev == -1 ? idx : idx-prev-1;
        diffMax = Math.max(diffMax, diff);
        prev = idx;
      }
      diffMax = Math.max(diffMax, S.length()-list.get(list.length()-1));
      ans = Math.min(ans, diffMax);
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:32: error: cannot find symbol
      diffMax = Math.max(diffMax, S.length()-list.get(list.length()-1));
                                                          ^
  symbol:   method length()
  location: variable list of type List<Integer>
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Map<Character, List<Integer>> map = new HasMap<>();
    for (int i = 0; i < S.length(); i++) {
      char c = S.charAt(i);
      List<Integer> list = map.get(c);
      if (list == null) {
        list = new ArrayList();
        map.put(c, list);
      }
      list.add(i);
    }
    
    int ans = 1000;
    for (List<Integer> list : map.values()) {
      int diffMax = 0;
      int prev = -1;
      for (int idx : list) {
        diffMax = Math.max(diffMax, idx-prev-1);
        prev = idx;
      }
      ans = Math.min(ans, diffMax);
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    Map<Character, List<Integer>> map = new HasMap<>();
                                            ^
  symbol:   class HasMap
  location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Map<Character, List<Integer>> map = new HasMap<>();
    for (int i = 0; S.length(); i++) {
      char c = S.charAt(i);
      List<Integer> list = map.get(c);
      if (list == null) {
        list = new ArrayList();
        map.put(c, list);
      }
      list.add(i);
    }
    
    int ans = 1000;
    for (List<Integer> list : map.values()) {
      int diffMax = 0;
      int prev = -1;
      for (int idx : list) {
        diffMax = Math.max(diffMax, idx-prev-1);
        prev = idx;
      }
      ans = Math.min(ans, diffMax);
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    Map<Character, List<Integer>> map = new HasMap<>();
                                            ^
  symbol:   class HasMap
  location: class Main
Main.java:8: error: incompatible types: int cannot be converted to boolean
    for (int i = 0; S.length(); i++) {
                            ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.nextInt();
    Map<Character, List<Integer>> map = new HasMap<>();
    for (int i = 0; S.length(); i++) {
      char c = S.charAt(i);
      List<Integer> list = map.get(c);
      if (list == null) {
        list = new ArrayList();
        map.put(c, list);
      }
      list.add(i);
    }
    
    int ans = 1000;
    for (List<Integer> list : map.values()) {
      int diffMax = 0;
      int prev = -1;
      for (int idx : list) {
        diffMax = Math.max(diffMax, idx-prev-1);
        prev = idx;
      }
      ans = Math.min(ans, diffMax);
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:6: error: incompatible types: int cannot be converted to String
    String S = sc.nextInt();
                         ^
Main.java:7: error: cannot find symbol
    Map<Character, List<Integer>> map = new HasMap<>();
                                            ^
  symbol:   class HasMap
  location: class Main
Main.java:8: error: incompatible types: int cannot be converted to boolean
    for (int i = 0; S.length(); i++) {
                            ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
Language: C++

///supercalifragilisticexpialidocious.
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <cstdlib>
#include <cctype>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <utility>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <complex>
using namespace std;
#define f first
//#define s second
#define PB pop_back 
#define pb push_back
#define mp make_pair
#define int long long
#define y1 y_golabi
#define sz(s) (int)s.size()
#define seper(n) setprecision(n)
#define all(v) v.begin(),v.end()
#define mem(a,b) memset(a,b,sizeof a)
#define IOS ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
typedef long long ll; 
typedef map<int , int> mii;
typedef pair<int , int> pii; 
typedef map<string , int> msi;
typedef pair<int , string> pis; 
typedef pair<int , pair<int , int> > piii;
int mn = INT_MAX , cnt;
string s , t , str;
bool is_Same(string s)
{
	for(int i = 0 ; i < sz(s) ; i ++)
		if(s[i] != s[0])
			return false;
	return true;
}
int32_t main()
{
	cin >> str;
	for(char ch = 'a' ; ch <= 'z' ; ch ++)
	{
		t = "" , s = str , cnt = 0;
		while(!is_Same(s))
		{
			t.clear();
			for(int i = 0 ; i < sz(s) - 1 ; i ++)
				if(s[i] == ch or s[i + 1] == ch)
					t += ch;
				else
					t += s[i];
			s = t , cnt ++;
		}
		mn = min(mn , cnt);
	}
	return cout << mn << endl , 0;
}


Compiler output:
a.cc:42:10: error: 'INT_MAX' was not declared in this scope
   42 | int mn = INT_MAX , cnt;
      |          ^~~~~~~
a.cc:23:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   22 | #include <complex>
  +++ |+#include <climits>
   23 | using namespace std;
a.cc: In function 'int32_t main()':
a.cc:56:36: error: 'cnt' was not declared in this scope; did you mean 'int'?
   56 |                 t = "" , s = str , cnt = 0;
      |                                    ^~~
      |                                    int
Language: C++

include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int ans = s.size();
	for (int i = 0; i < s.size(); i++) {
	  char c = s[i];
	  int cnt=0,temp=0;
	  for (int j = 0; j < s.size(); j++) {
	    if (s[s.size() - j - 1] != c) {
		  cnt++;
		}
        else {
		  cnt=0;
		}
		temp = max(temp, cnt);
	  }
	  ans = min(ans, temp);
	}
  cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s;
      |   ^~~
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:17:24: error: 'max' was not declared in this scope
   17 |                 temp = max(temp, cnt);
      |                        ^~~
a.cc:19:17: error: 'min' was not declared in this scope; did you mean 'main'?
   19 |           ans = min(ans, temp);
      |                 ^~~
      |                 main
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout << ans << endl;
      |   ^~~~
a.cc:21:18: error: 'endl' was not declared in this scope
   21 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  string s;cin>>s;
  int ret  = 1000;
  for(char i = 'a';'z' >= i; i++){
    int mx=0;
    int nw = 0
    for(int j = 0; s.size() > j; j++){
      if(s[j]!=i){
        nw++;
      }else{
        mx = max(mx,nw);
        nw = 0;
      }
    }
    ret = min(ret,mx);
  }
  cout << ret << endl;
}
  

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

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

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

    int ans = INT_MAX;
    for (char c = 'a'; c <= 'z'; c++) {
        int cnt = 0;
        while (count(s.begin(), s.end(), c) != s.size()) {
            string ns = "";
            rep (j, s.size()-1) {
                if (s[j] == c || s[j+1] == c) ns += c;
                else ns += s[i];
            }
            s = ns;
            cnt++;
        }
        ans = min(ans, cnt);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: 'i' was not declared in this scope
   15 |                 else ns += s[i];
      |                              ^
Language: C++

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

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

    int ans = INT_MAX;
    for (char c = 'a'; c <= 'z'; c++) {
        int cnt = 0;
        while (count(s.begin(), s.end(), c) != s.size()) {
            string ns = "";
            rep (j, s.size()-1) {
                if (s[j] == c || s[i+1] == c) ns += c;
                else ns += s[i];
            }
            s = ns;
            cnt++;
        }
        ans = min(ans, cnt);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: 'i' was not declared in this scope
   14 |                 if (s[j] == c || s[i+1] == c) ns += c;
      |                                    ^
Language: C++

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

int main(){
	string s;cin>>s;
	int ans=1e9,tmp1=0,tmp0=0;
	for(int i=0;i<26;i++){
	  char c='a'+i;
	  tmp1=0;tmp0=0;
	for(int j=0;j<s.size();j++){  
	if(s[j]!=c)tmp0++;
	 else{
		tmp1=max(tmp1,tmp0);tmp0=0;
		}
	}
	tmp1=max(tmp1,tmp0);
	}
	ans=min(ans,tmp1);
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc:20:9: error: 'cout' does not name a type
   20 |         cout<<ans<<endl;
      |         ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
constexpr int INF = 1LL<<60;

signed main() {
  string s; cin>>s;
  vector<int> cnt(26,0);
  REP(i,s.size()){
    // 出現する文字数をカウント
    ++cnt[s[i]-'a'];
  }
 
  int ans = INF;
  for(int i=0;i<26;++i){
    // 出現しなかった文字はスルー
    if(!cnt[i]) continue;

    string cpy_s = s;
    int cnt = 0;

    // breakを含んでいるので, 兵庫県警には捕まりません
    while(true){
      // 全ての文字が同じ文字の時はbreak
      if(string(cpy_s.size(), cpy_s[0])==cpy_s) break;

      // i文字目かi+1文字目に'a'+iがあれば, それに変更(操作)
      for(int j=0;j<cpy_s.size();++j){
        if(cpy_s[j+1]=='a'+i || cpy_s[j]=='a'+i) cpy_s[j]='a'+i;
      }
      // 末尾を削除
      cpy_s.pop_back();
      ++cnt;
    }
    ans = min(ans,cnt);
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   REP(i,s.size()){
      |       ^
a.cc:10:3: error: 'REP' was not declared in this scope
   10 |   REP(i,s.size()){
      |   ^~~
Language: C++

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

signed main() {
  string s; cin>>s;
  vector<int> cnt(26,0);
  REP(i,s.size()){
    // 出現する文字数をカウント
    ++cnt[s[i]-'a'];
  }
 
  int ans = INF;
  for(int i=0;i<26;++i){
    // 出現しなかった文字はスルー
    if(!cnt[i]) continue;

    string cpy_s = s;
    int cnt = 0;

    // breakを含んでいるので, 兵庫県警には捕まりません
    while(true){
      // 全ての文字が同じ文字の時はbreak
      if(string(cpy_s.size(), cpy_s[0])==cpy_s) break;

      // i文字目かi+1文字目に'a'+iがあれば, それに変更(操作)
      for(int j=0;j<cpy_s.size();++j){
        if(cpy_s[j+1]=='a'+i || cpy_s[j]=='a'+i) cpy_s[j]='a'+i;
      }
      // 末尾を削除
      cpy_s.pop_back();
      ++cnt;
    }
    ans = min(ans,cnt);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   REP(i,s.size()){
      |       ^
a.cc:9:3: error: 'REP' was not declared in this scope
    9 |   REP(i,s.size()){
      |   ^~~
a.cc:14:13: error: 'INF' was not declared in this scope
   14 |   int ans = INF;
      |             ^~~
Language: C++

//In The Name of Beauty
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define IB std::ios::sync_with_stdio(0);
#define pb(x) push_back(x);
#define mp(x,y) make_pair(x,y)
#define pll pair<ll,ll>
#define F first
#define S second
ll const MAXN = 1e5 + 8;
ll const INF  = 1e12 + 8;
ll const delta = 1000000007;
ll last[30];
int main()
{
    IB;
    cin.tie(0);
    cout.tie(0);
    string s;
    cin >> s;
    ll ans = s.size() - 1;
    for(ll i = 0;i < 30;i++)last[i] = -1;
    for(ll i = 0;i < 30;i++){
        ll temp = 0;
        for(ll j = 0;j < s.size();j++){
            if(s[j] != 'a' + i)continue;
            if(last[i] == -1)temp = max(temp,j);
            else temp = max(temp,j - last[i] - 1);
            last[i] = j;
        }
        if(last[i] == -1)continue;
        temp = max(temp,s.size() - last[i] - 1);
        ans = min(ans,temp);
    }
    cout << ans;
    return 0;
}
//Written by M_H_H_7


Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: no matching function for call to 'max(ll&, long long unsigned int)'
   34 |         temp = max(temp,s.size() - last[i] - 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:2:
/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:34:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   34 |         temp = max(temp,s.size() - last[i] - 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:34:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   34 |         temp = max(temp,s.size() - last[i] - 1);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
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; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<58;
 
int main(){
    string s;
  	cin >> s;
  	set<char> chars;
  	for(ll i = 0; i < s.length(); ++i) chars.insert(S[i]);
  
  	if(chars.size() == 1){
      cout << 0 << endl;
      return 0;
    }
  
  	ll res = 100, times;
  	for(auto key = chars.begin(); key != chars.end(); ++key){
      string str = s;
      bool flag = true;
      times = 1;
      
      while(flag){
        string vacant;
        flag = false;
        for(ll i = 0; i < str.length()-1; ++i){
          // shrink
          if (str[i] == *key　|| str[i+1] == *key){
            vacant += *key;
          } else {
            vacant += str[i];
            flag = true;
          }
        }
        
        if(flag) {
          str = vacant;
          times++;
        }
      }
      chmin(res,times);
    }
  	cout << res << endl;
}

Compiler output:
a.cc:50:26: error: extended character 　 is not valid in an identifier
   50 |           if (str[i] == *key　|| str[i+1] == *key){
      |                          ^
a.cc: In function 'int main()':
a.cc:32:57: error: 'S' was not declared in this scope
   32 |         for(ll i = 0; i < s.length(); ++i) chars.insert(S[i]);
      |                                                         ^
a.cc:50:26: error: 'key\U00003000' was not declared in this scope
   50 |           if (str[i] == *key　|| str[i+1] == *key){
      |                          ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int c=0;
  while(true){
    map<char,int> m;
    bool f=true;
    for(int i=0;i<s.size();i++){
      m[s[i]]++;
      if(i>0){
        if(s[i]!=s[i-1]) f=false;
      }
    }
    if(f){
      cout<<c;
      return 0;
    }
    string t(s.size()-1,'');
    for(int i=0;i<s.size()-1;i++){
      if(m[s[i]]<m[s[i+1]]) t[i]=s[i+1];
      else t[i]=s[i];
    }
    s=t;
    c++;
  }
}

Compiler output:
a.cc:20:25: error: empty character constant
   20 |     string t(s.size()-1,'');
      |                         ^~
Language: C++

using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		string s = Console.ReadLine();
    string alphabets = "abcdefghijklmnopqrstuvwxyz";//26文字
    int n = s.Length;
		long answer = 1000;
    long answerMemo = 0;
    long answerMemoMax = 0;
    
    for(int i = 0; i < 26; i++)
    {
      for(int j = 0; j < n; j++)
      {
        if(s[j] == alphabets[i])
        {
          answerMemoMax = Math.Max(answerMemoMax, answerMemo);
          answerMemo = 0;
        }else
        {
          answerMemo++;
        }
        answerMemoMax = Math.Max(answerMemoMax, answerMemo);
      }
      //Console.WriteLine(i + " " +answerMemoMax);
      answer = Math.Min(answer, answerMemoMax);
      answerMemo = 0;
      answerMemoMax = 0;
    }

    
		Console.WriteLine(answer);
	}
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;//リストの使用
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;//テキストの高速出力に必要
      |       ^~~~~~
a.cc:39:2: error: expected ';' after class definition
   39 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:9:17: error: 'string' was not declared in this scope
    9 |                 string s = Console.ReadLine();
      |                 ^~~~~~
a.cc:10:12: error: expected ';' before 'alphabets'
   10 |     string alphabets = "abcdefghijklmnopqrstuvwxyz";//26文字
      |            ^~~~~~~~~
a.cc:11:13: error: 's' was not declared in this scope
   11 |     int n = s.Length;
      |             ^
a.cc:20:20: error: 'alphabets' was not declared in this scope
   20 |         if(s[j] == alphabets[i])
      |                    ^~~~~~~~~
a.cc:22:27: error: 'Math' was not declared in this scope
   22 |           answerMemoMax = Math.Max(answerMemoMax, answerMemo);
      |                           ^~~~
a.cc:28:25: error: 'Math' was not declared in this scope
   28 |         answerMemoMax = Math.Max(answerMemoMax, answerMemo);
      |                         ^~~~
a.cc:31:16: error: 'Math' was not declared in this scope
   31 |       answer = Math.Min(answer, answerMemoMax);
      |                ^~~~
a.cc:37:17: error: 'Console' was not declared in this scope
   37 |                 Console.WriteLine(answer);
      |                 ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define llong long long int
#define ullong unsigned long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
const static long long int MOD = 1000000000 + 7;
const static int dy[] = {0, 1, 0, -1};
const static int dx[] = {1, 0, -1, 0};

int main(int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
	
	int ret = 99;
	for (int i = 0 ; i < 26 ; i ++){
		char c = 'a' + i;
		int pre = -1;
		int cnt = 0;
		for (int j = 0 ; j < s.size() ; ++j){
			if(s[j] == c){
				cnt = max(cnt, j - pre);
				pre = j;
			}
		}
		cnt = max(cnt ,(int)s.size() - pre);
		ret = min(ret, cnt - 1);
	}

	cout << ret << endl;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:20:38: error: 's' was not declared in this scope
   20 |                 for (int j = 0 ; j < s.size() ; ++j){
      |                                      ^
a.cc:26:37: error: 's' was not declared in this scope
   26 |                 cnt = max(cnt ,(int)s.size() - pre);
      |                                     ^
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
using namespace std;

#define INF (1ll<<60)


long long M = 1000000007;


int main(int argc, char const *argv[]) {
    string s;cin>>s;
    int n=s.length();
    int res = 1<<30;
    for(int i=0;i<n;++i){
        char c = s[i];
        int ma = 0,tmp = 0;
        for(int i=0;i<n;++i){
            if(s[i]!=c)tmp++;
            else tmp = 0;
            ma = max(ma,tmp);
        }
        res = min(ma,res);
    }
    cout<<res<<endl;
    return 0;
}#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
using namespace std;

#define INF (1ll<<60)


long long M = 1000000007;


int main(int argc, char const *argv[]) {
    string s;cin>>s;
    int n=s.length();
    int res = 1<<30;
    for(int i=0;i<n;++i){
        char c = s[i];
        int ma = 0,tmp = 0;
        for(int i=0;i<n;++i){
            if(s[i]!=c)tmp++;
            else tmp = 0;
            ma = max(ma,tmp);
        }
        res = min(ma,res);
    }
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc:36:2: error: stray '#' in program
   36 | }#include <cmath>
      |  ^
a.cc:36:3: error: 'include' does not name a type
   36 | }#include <cmath>
      |   ^~~~~~~
a.cc:52:11: error: redefinition of 'long long int M'
   52 | long long M = 1000000007;
      |           ^
a.cc:17:11: note: 'long long int M' previously defined here
   17 | long long M = 1000000007;
      |           ^
a.cc:55:5: error: redefinition of 'int main(int, const char**)'
   55 | int main(int argc, char const *argv[]) {
      |     ^~~~
a.cc:20:5: note: 'int main(int, const char**)' previously defined here
   20 | int main(int argc, char const *argv[]) {
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int cnt=0,c=0,mi=10000;
  for(int i=0;i<s.size();i++){
    for(int j=0;j<s.size();j++){
      if(s[i]==s[j]){
        c=max(c,cnt);
        cnt=0;
      }else{
        cnt++;
      }
    }
    c=max(mc,cnt);
    cnt=0;
    mi=min(mc,mi);
    c=0;
  }
  cout<<mi<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'mc' was not declared in this scope; did you mean 'mi'?
   16 |     c=max(mc,cnt);
      |           ^~
      |           mi
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int cnt=0,c=0,mi=10000;
  for(int i=0;i<s.size();i++){
    for(int j=0;j<s.size();j++){
      if(s[i]==s[j]){
        mc=max(c,cnt);
        cnt=0;
      }else{
        cnt++;
      }
    }
    c=max(mc,cnt);
    cnt=0;
    mi=min(mc,mi);
    c=0;
  }
  cout<<mi<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'mc' was not declared in this scope; did you mean 'mi'?
   10 |         mc=max(c,cnt);
      |         ^~
      |         mi
a.cc:16:11: error: 'mc' was not declared in this scope; did you mean 'mi'?
   16 |     c=max(mc,cnt);
      |           ^~
      |           mi
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int cnt=0,c=0,mi=10000;
  for(int i=0;i<s.size();i++){
    for(int j=0;j<s.size();j++){
      if(s[i]==s[j]){
        mc=max(c,cnt);
        cnt=0;
      }else{
        cnt++;
      }
    }
    mc=max(mc,cnt);
    cnt=0;
    mi=min(mc,mi);
    c=0;
  }
  cout<<mi<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'mc' was not declared in this scope; did you mean 'mi'?
   10 |         mc=max(c,cnt);
      |         ^~
      |         mi
a.cc:16:5: error: 'mc' was not declared in this scope; did you mean 'mi'?
   16 |     mc=max(mc,cnt);
      |     ^~
      |     mi
Language: C++

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

int main() {
	string s;
	cin >> s;
	int ans = 110;
	for (char a = 'a'; a <= 'z'; a++) {
		string t = s, now = "";
		for (int i = 0; i < s.size(); i++) {
			bool flag = true;
			for (int j = 0; j < t.size() - 1; j++) {
				if (t[j] != a && t[j + 1] == a)now = now + a;
				else now = now + t[j];
				if (t[j] != a && t[j + 1] != a)flag = false;
			}
			if (flag == true) {
				ans = min(i, ans);
				//if(ans == s.size() - i)cout << a << endl;
				break;
			}
			t = now, now = "";
		}
	}
	if (ans == 0)cout << ans << endla;
	else cout << ans + 1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:37: error: 'endla' was not declared in this scope
   27 |         if (ans == 0)cout << ans << endla;
      |                                     ^~~~~
Language: C++

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

ll GCD(ll a, ll b) {
	if (b == 0)return a;
	return GCD(b, a%b);
}

ll LCM(ll a, ll b) {
	return a / GCD(a, b)*b;
}

ll mypow(ll a, ll b, ll c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	else return mypow(a, b / 2, c)*mypow(a, b / 2, c) % c;
}

ll longmax(ll a,ll b){
	if(a>b) return a;
	else return b;
}

ll longmin(ll a,ll b){
	if(a<b) return a;
	else return b;
}

signed main(){
	string s;
	map<char,int> m;
	cin>>s;
	int ans=INT;
	for(int j=0;j<26;j++){
		int b[a+1],d=0,e=0;
		f(i,s.size()){
			if(s[i]=='a'+j){
				b[d]=i;
				d++;
			}
		}
		b[a]=s.size();
		for(int i=a;i>=0;i--){
			if(i) b[i]-=b[i-1]+1;
			e=max(e,b[i]);
		}
		ans=min(ans,e);
	}
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:23: error: 'a' was not declared in this scope
   40 |                 int b[a+1],d=0,e=0;
      |                       ^
a.cc:43:33: error: 'b' was not declared in this scope
   43 |                                 b[d]=i;
      |                                 ^
a.cc:47:17: error: 'b' was not declared in this scope
   47 |                 b[a]=s.size();
      |                 ^
Language: C++

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

int main() {
	long n,c=1,r=0;
	cin>>n;
	vector<long>v(n);
	for(int i=0;i<n;i++)cin>>v.at(i);
	sort(v.begin(),v.end());
	for(int i=0;i<n-1;i++){
		if(v.at(i)!=v.at(i+1)){
			c++;
			r=(i+1);
		}
	}
	if(n>=3){
		
	
	if(c==1){
		if(v.at(0)==(n-1)||v.at(0)<=n/2){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	else if(c==2){
		if((2*v.at(0)+2)<=(r+n)&&r<=v.at(0)&&v.at(1)!=1){
			
			if(v.at(0)!=1){
			cout<<"Yes"<<endl;	
			}
			else if(v.at(0)==1){
				if(v.at(1)==2){
					cout<<"Yes"<<endl;
				}
				else{
					cout<<"No"<<endl;
			　　　　　　
				}
			}
			else{
			cout<<"No"<<endl;
			}
		}
		else{
			cout<<"No"<<endl;
		}
	
	}
	else{
		cout<<"No"<<endl;
		
	}
	}
	else{
		if(v.at(0)==v.at(1)&&v.at(1)==1){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:39:25: error: extended character 　 is not valid in an identifier
   39 |                         　　　　　　
      |                         ^
a.cc:39:25: error: extended character 　 is not valid in an identifier
a.cc:39:25: error: extended character 　 is not valid in an identifier
a.cc:39:25: error: extended character 　 is not valid in an identifier
a.cc:39:25: error: extended character 　 is not valid in an identifier
a.cc:39:25: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:39:25: error: '\U00003000\U00003000\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   39 |                         　　　　　　
      |                         ^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
 
#define int long long
 
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define FORR(i,m,n) for(int i=m;i>=n;i--)
#define pb(x) push_back(x) 
#define SORT(x) sort((x).begin(),(x).end())
#define INF 999999999999
 
using namespace std;

int32_t main(){
    string str;
    cin >> str;

    int n=str.length();
    int m=('z'-'a');

    vector<int> memo(26, 0);
    REP(i, m){
        vector<int> v(1, -1);
        REP(j, n){
            if((char)('a'+i) == str[j]){
                v.pb(j);
            }
        }
        v.pb(n);

        REP(j, v.size()-1){
            memo[i]=max(memo[i], v[j+1]-v[j]);
        }
    }   

    SORT(v);
    cout << v[0]-1 << endl;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:36:10: error: 'v' was not declared in this scope
   36 |     SORT(v);
      |          ^
a.cc:9:23: note: in definition of macro 'SORT'
    9 | #define SORT(x) sort((x).begin(),(x).end())
      |                       ^
Language: C++

def solve( s , c ):
    cnt = int(0)
    while 1 :

        if len(s) == 0 :
            return cnt

        f = True

        for i in range(len(s)):
            if s[i] != c:
                f = False
                break
        
        if f :
            return cnt


        s2 = ""
        for i in range(len(s)-1):
            if s[i] == c or s[i+1] == c:
                s2 += c
            else:
                s2 += s[i]
         
        s = s2
        cnt += 1

    return cnt;



s = input()
a = [0 for i in range(26)]

for i in range(len(s)):
    a[ord(s[i])-ord('a')] += 1

ans = 0x7FFFFFFF
for i in range(26):
    if(a[i] > 0 ):
        ans = min( ans , solve(s, chr( i + ord('a') ) ) )

print(ans)


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def solve( s , c ):
      | ^~~
a.cc:33:1: error: 's' does not name a type
   33 | s = input()
      | ^
Language: C++

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

string s;

int solve(vector<int> x){
  int ret = 0;
  if (x.empty()) ret = s.size();
  else{
    for(int i=0;i+1<x.size();i++){
      ret = max(ret, x[i+1] - x[i] - 1);
    }
    ret = max(ret, x[0]);
    ret = max(ret, s.size() - x[x.size()-1] - 1);
  }
  return ret;  
}
int main(void){
  cin >> s;
  int ans = INT_MAX;
  for(int i=0;i<26;i++){
    vector<int> idx;
    for(int j=0;j<s.size();j++){
      if (s[j]=='a'+i) idx.push_back(j);
    }
    ans = min(ans, solve(idx));
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int solve(std::vector<int>)':
a.cc:14:14: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
   14 |     ret = max(ret, s.size() - x[x.size()-1] - 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:14:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   14 |     ret = max(ret, s.size() - x[x.size()-1] - 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:14:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |     ret = max(ret, s.size() - x[x.size()-1] - 1);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

using namespace std;
int sub(const string& s, char c) {
  stringstream ss(c + s + c);
  int mx = 0;
  string buf;
  while(getline(ss, buf, c)) {
    mx = max(mx, buf.size());
  }
  return mx;
}


int main() {
  string s;
  cin >> s;
  
  int mn = 1e9;
  for(char c = 'a'; c <= 'z'; ++c) {
    mn = min(mn, sub(s, c));
  }
  cout << mn << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int sub(const std::string&, char)':
a.cc:12:13: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
   12 |     mx = max(mx, buf.size());
      |          ~~~^~~~~~~~~~~~~~~~
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:12:13: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   12 |     mx = max(mx, buf.size());
      |          ~~~^~~~~~~~~~~~~~~~
/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:4:
/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:12:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   12 |     mx = max(mx, buf.size());
      |          ~~~^~~~~~~~~~~~~~~~
Language: C++

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

int main(){
	string z;
	cin>>z;
	
	int ans=1e9+7;
	
	for(int i=0;i<26;i++){
		int exflag=1;
		for(int j=0;j<z.size();j++)if(z[j]!=char('a'+i))exflag=0;
		if(exflag==1)ans=0;;
		string s=z;
		int ssi=s.size();
		int flag=1;
		while(1){
			string ns(ssi-1,'0');
			for(int k=0;k<ssi;k++){
				if(s[k]==char('a'+i)||s[k+1]==char('a'+i)){
					ns[k]=('a'+i);
				}else{
					ns[k]='0';
				}
			}
			ssi--;
			//cout<<char('a'+i)<<endl;
			//cout<<s<<endl;
			//cout<<ssi<<endl;
			flag=1;
			for(int j=0;j<ssi;j++)if(ns[j]!=char('a'+i))flag=0;
			if(flag==1||ssi<=1)break;
			s=ns;
		}
		int aaaa=z.size()-ssi;
		ans=min(ans,aaaa);
	}
	
	cout<<ans<<endl;
	return 0;
}

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

from collections import Counter
s = input()
count = Counter(s).most_common()
ans = 100
for c,n in count:
    ss = s
    cnt = 0
    while any(ssi != ss[0] for ssi in ss):
        ss_new = ""
        for i in range(len(ss)-1):
            if ss[i] != c and ss[i+1] == c:
                ss_new += c
            else:
                ss_new += ss[i]
        ss = ss_new
        cnt += 1
    if cnt < ans:
        ans = cnt

print(ans)

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

import java.util.Scanner;

public class A {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int mi = 200;
    for (char i = 'a'; i <= 'z'; i++) {
      int m = 0;
      String[] ws = s.split("" + i);
      for (String w : ws) {
        m = Math.max(m, w.length());
      }
      mi = Math.min(m, mi);
    }
    System.out.println(mi);
  }
}

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

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

using namespace std;
string s;
int MIN = 1000;
int main() {
  cin >> s;

  for(int i = 0; i < 26; i++) {
    string aa = s;
    string tmp(aa.size(),'a'+i);
    int ans = 0;
    while(true) {
      if(tmp == aa) break;

      for(int j = 0; j < aa.size(); j++) {
	if(aa[j+1] == 'a'+i) aa[j] = aa[j+1];
      }
      aa.pop_back();
      tmp.pop_back();
      ans++;
    }
    MIN = min(MIN,ans);
  }
  cout << MIN << endl;
}
			      


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | w#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'w' does not name a type
    1 | w#include <bits/stdc++.h>
      | ^
a.cc:4:1: error: 'string' does not name a type
    4 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> s;
      |   ^~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:10:5: error: 'string' was not declared in this scope
   10 |     string aa = s;
      |     ^~~~~~
a.cc:11:11: error: expected ';' before 'tmp'
   11 |     string tmp(aa.size(),'a'+i);
      |           ^~~~
      |           ;
a.cc:14:10: error: 'tmp' was not declared in this scope
   14 |       if(tmp == aa) break;
      |          ^~~
a.cc:14:17: error: 'aa' was not declared in this scope
   14 |       if(tmp == aa) break;
      |                 ^~
a.cc:16:26: error: 'aa' was not declared in this scope
   16 |       for(int j = 0; j < aa.size(); j++) {
      |                          ^~
a.cc:19:7: error: 'aa' was not declared in this scope
   19 |       aa.pop_back();
      |       ^~
a.cc:20:7: error: 'tmp' was not declared in this scope
   20 |       tmp.pop_back();
      |       ^~~
a.cc:23:11: error: 'min' was not declared in this scope; did you mean 'main'?
   23 |     MIN = min(MIN,ans);
      |           ^~~
      |           main
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout << MIN << endl;
      |   ^~~~
a.cc:25:18: error: 'endl' was not declared in this scope
   25 |   cout << MIN << endl;
      |                  ^~~~