criyle/codenet-compile-errors huggingface dataset:
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 count = 0;
  rep(i,s.length()) if(s[i] == '0') count++;
  cout << max(count, s.length() - count) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
    9 |   cout << max(count, s.length() - count) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
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:9:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
    9 |   cout << max(count, s.length() - count) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:9:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    9 |   cout << max(count, s.length() - count) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
int main()
{
	string s;
	cin>>s;
	int i,n=s.size();
	int l[n],r[n];
	for(i=0;i<n;++i)
	{
		if(s[i]=='0')
		{
			if(i==0)	l[i]=1;
			else		l[i]=l[i-1]+1;
		}
		else
		{
			l[i]=0;
		}
	}
	for(i=n-1;i>=0;i--)
	{
		if(s[i]=='0')
		{
			if(i==n-1)	r[i]=1;
			else		r[i]=r[i+1]+1;
		}
		else
		{
			r[i]=0;
		}
	}
//	for(i=0;i<n;++i)	printf("%d ",l[i]);	printf("\n");
//	for(i=0;i<n;++i)	printf("%d ",r[i]);	printf("\n");
	int ans = 0;
	for(i=0;i<n;++i)
	{
		int cnt = 0;
		if(i!=0)		cnt+=l[i-1];
		if(i!=n-1)		cnt+=r[i+1];
		ans=max(ans,cnt);
	}
	cout<<ans;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
int main()
{
	string s;
	cin>>s;
	int i,n=s.size();
	int l[n],r[n];
	for(i=0;i<n;++i)
	{
		if(s[i]=='0')
		{
			if(i==0)	l[i]=1;
			else		l[i]=l[i-1]+1;
		}
		else
		{
			l[i]=0;
		}
	}
	for(i=n-1;i>=0;i--)
	{
		if(s[i]=='0')
		{
			if(i==n-1)	r[i]=1;
			else		r[i]=r[i+1]+1;
		}
		else
		{
			r[i]=0;
		}
	}
//	for(i=0;i<n;++i)	printf("%d ",l[i]);	printf("\n");
//	for(i=0;i<n;++i)	printf("%d ",r[i]);	printf("\n");
	int ans = 0;
	for(i=0;i<n;++i)
	{
		int cnt = 0;
		if(i!=0)		cnt+=l[i-1];
		if(i!=n-1)		cnt+=r[i+1];
		ans=max(ans,cnt);
	}
	cout<<ans;
}


Compiler output:
a.cc:53:5: error: redefinition of 'int main()'
   53 | int main()
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main()
      |     ^~~~
Language: C++

#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



int SSSSmain() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string S;
    cin >> S;
    ll ans = 0;
    int N = S.size();
    bool is_g_search = true;
    int g_num = 0, p_num = 0;
    rep(i, N) {
        if (is_g_search == true) {
            if (S[i] == 'g') {
                g_num++;
            }
            else {
                is_g_search = false;
                p_num = 1;
            }
        }

        else {
            if (S[i] == 'p') {
                p_num++;
            }
            else {
                if (g_num > p_num) {
                    ans += (g_num - p_num) / 2;
                    g_num = (g_num % 2) + 1;
                }
                else {
                    ans += (g_num - p_num)/2;
                    auto tmp = g_num;
                    g_num = 1;
                    if ((tmp - p_num) % 2 != 0) {
                        ans--;
                        g_num++;
                    }
                    
                }
                p_num = 0;
                is_g_search = true;
            }
            
        }
    }
    if (g_num > p_num) {
        ans += (g_num - p_num) / 2;
        g_num = (g_num % 2) + 1;
    }
    else {
        ans += (g_num - p_num) / 2;
        auto tmp = g_num;
        g_num = 1;
        if ((tmp - p_num) % 2 != 0) {
            ans--;
            g_num++;
        }

    }
    cout << ans << endl;
    return 0;
}

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: Java

import java.util.Scanner;
 
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String S = scan.next();
    int ans = 0;
    if(S.length()%2==0){
      if(S.charAt(S.length() /2 -1)! = S.charAt(S.length() /2)){
        System.out.println(S.length() /2);
        return;
      }else{
        S = S.substring(0, S.length() /2) + S.substring(S.length() /2 +1);
        ans =1;
      }
    }
    int mid = S.length() /2;
    for(int i=1;i+mid <= S.length();++i){
      if(i+mid==S.length() || S.charAt(mid+i)!=S.charAt(mid) || S.charAt(mid-i)!=S.charAt(mid)){
        ans += mid + i;
        break;
      }
    }
    System.out.println(ans);
  }
}
      

Compiler output:
Main.java:9: error: ')' expected
      if(S.charAt(S.length() /2 -1)! = S.charAt(S.length() /2)){
                                   ^
Main.java:9: error: illegal start of expression
      if(S.charAt(S.length() /2 -1)! = S.charAt(S.length() /2)){
                                     ^
Main.java:9: error: ';' expected
      if(S.charAt(S.length() /2 -1)! = S.charAt(S.length() /2)){
                                                              ^
Main.java:12: error: 'else' without 'if'
      }else{
       ^
4 errors
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007

int main() {
    string s;
    cin >> s;
    int n = s.size();
    vector<int> a(n);
    for(size_t i = 0; i < n; i++) {
        a[i] = s[i] - '0';
    }
    vector<int> rui(n + 1, 0);
    for(size_t i = 0; i < n; i++) {
        rui[i + 1] = rui[i] + a[i];
    }
    int k = n;
    ll ans;
    while(k--) {
        if(n - k > k) {
            continue;
        } else {
            if(rui[k] - rui[n - k] == 0 || rui[k] - rui[n - k] == 2 * k - n) {
                ans = k;
                break;
            }
        }
    }
    ans = min(ans, rui[n]);
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:14: error: no matching function for call to 'min(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   31 |     ans = min(ans, rui[n]);
      |           ~~~^~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:31:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   31 |     ans = min(ans, rui[n]);
      |           ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:31:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   31 |     ans = min(ans, rui[n]);
      |           ~~~^~~~~~~~~~~~~
Language: C

#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;

#define rep(i,n) for(int i=0; i<((int)n); i++)
#define REP(i,n) for(int i=0; i<=((int)n); i++)
#define srep(i,a,n) for(int i=a; i<((int)n); i++)
#define SREP(i,a,n) for(int i=a; i<=((int)n); i++)
#define rrep(i,n) for(int i=n-1; i>=0; i--)
#define RREP(i,n) for(int i=n; i>=0; i--)
#define INF 1000000000
const int mod = INF+7;

//反転とか
//2回やったら元に戻る
//操作の順序を入れ替えても結果が変わらない。
//この問題の場合、（端から考えることによって）貪欲的に決まっていく。
//計算量削減のため、差分を考えることも重要。

//境界に注目するの大事
//境界を１つずつ減らしていくイメージ

int max(int a, int b){
  if(a>=b){
    return a;
  }
  else{
    return b;
  }
}

int main(){
  string s;
  cin >> s;
  int s_len=s.size();
  int k=s_len;

  srep(i,1,s_len){
    if(s[i-1]!=s[i]){
      if(k>max(i+1, s_len-i)){
        k=max(i+1, s_len-i);
      }
    }
  }

  cout << k << endl;
}


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

#include <algorithm>
#include <cfloat>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define ll long long
#define eps LDBL_EPSILON
#define mod 1000000007
#define int long long
#define double long double
#define INF LLONG_MAX/1000
#define P pair<int,int>
#define prique priority_queue
using namespace std;
string s;
signed main() {
	cin >> s;
	int ans = INF;
	rep(i, s.size() - 1) {
		if (s[i] != s[i + 1]) {
			ans = min(ans, max(i + 1, s.size() - i - 1));
		}
	}
	if (ans != INF)cout << ans << endl;
	else cout << s.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:43: error: no matching function for call to 'max(long long int, long long unsigned int)'
   38 |                         ans = min(ans, max(i + 1, s.size() - i - 1));
      |                                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 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:38:43: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   38 |                         ans = min(ans, max(i + 1, s.size() - 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:38:43: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   38 |                         ans = min(ans, max(i + 1, s.size() - i - 1));
      |                                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  string s; cin >> s;
  int t = 1000000000;
  for(int i=0;i<s.length()-1;i++){
    if(s[i]!=s[i+1])
      t = min(t,max(i+1, s.length()-i-1));
  }
  cout << t << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: no matching function for call to 'max(int, std::__cxx11::basic_string<char>::size_type)'
    9 |       t = min(t,max(i+1, s.length()-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: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:9:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
    9 |       t = min(t,max(i+1, s.length()-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:9:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    9 |       t = min(t,max(i+1, s.length()-i-1));
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

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

#define lli long long int
#define REP(i,n) for(lli i=0;i<n;i++)
#define LINF 1LL<<60

using namespace std;

int main(){

	lli ans = LINF;

	string str;
	cin>>str;

	REP(i,str.size()-1){
		if(str[i]!=str[i+1]){
			ans = min(ans,max(i+1,str.size()-i-1));
		}
	}
	if(ans == LINF)cout<<str.size()<<endl;
	else cout<<ans<<endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:42: error: no matching function for call to 'max(long long int, long long unsigned int)'
   20 |                         ans = min(ans,max(i+1,str.size()-i-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:20:42: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   20 |                         ans = min(ans,max(i+1,str.size()-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,
                 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:20:42: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |                         ans = min(ans,max(i+1,str.size()-i-1));
      |                                       ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  string S;cin>>S;
  int N=S.size();
  int best=0;
  int tmp=0;
  for(int i=0;i<N;++i){
    if(i==0){tmp++;}
    else if(S[i-1]==S[i]){tmp++;}
    else{
      best=max(best, tmp);
      tmp=1;
    }
  }

  ans=max(best+1, (N-1)/2+1);

  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   ans=max(best+1, (N-1)/2+1);
      |   ^~~
      |   abs
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#define int long long
using namespace std;
signed main() {
	string s; cin >> s;
	int ans = s.size();
	for (int i = 1; i < s.size(); i++) 
		if (s[i] != s[i - 1])ans = min(ans, max(i, s.size() - i));
	cout << ans << endl;
}

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

#include <iostream>
#include <cstring>
#include <stdio.h>
#include <math.h>
using namespace std;


int min(int a,int b)
{
    return a<b?a:b;
}
int max(int a,int b)
{
    return a>b?a:b;
}


int main(void){
    cin >> s;
    int rez=strlen(s);
    for (int i=1; i<strlen(s); i++)
    {
        if (s[i]!=s[i-1])
                 {
                    rez=min(rez,max(i,strlen(s)-i));
                 }
    }
    cout << rez;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 's' was not declared in this scope
   19 |     cin >> s;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin>>s;
	ll ans=n;
	int n=s.size();
	rep(i,n-1){
		if(s[i]==s[i+1])continue;
		chmin(ans,max(i+1,n-i-1));
	}
	puta(ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:16: error: 'n' was not declared in this scope
   56 |         ll ans=n;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+100;
char s[maxn];
int main()
{
    while (scanf("%s",s)!=EOF)
    {
        int l=strlen(s);
        ans=l;
        for (int i=1;i<l;i++)
            if (s[i-1] != s[i])
                ans=min(ans,max(i,l-i));
        printf("%d\n",ans);
    }
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+100;
char s[maxn];
int ans=0x3f3f3f3f;
int main()
{
    scanf("%s",s)
        int l=strlen(s);
        for (int i=1;i<l;i++)
            if (s[i-1] != s[i])
                ans=min(ans,max(i,l-i));
        printf("%d\n",ans);
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before 'int'
    8 |     scanf("%s",s)
      |                  ^
      |                  ;
    9 |         int l=strlen(s);
      |         ~~~       
a.cc:10:24: error: 'l' was not declared in this scope
   10 |         for (int i=1;i<l;i++)
      |                        ^
Language: C++

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

int main(){
	string s;
	cin >> s;
	int len = strlen(s), ans = len;
	for(int i = 1; i < len; i++){
		if(s[i] != s[i-1])
			ans = min(ans,max(i,len-i));
	}
	cout << ans << endl; 
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'strlen' was not declared in this scope
    9 |         int len = strlen(s), ans = len;
      |                   ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc:12:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |                         ans = min(ans,max(i,len-i));
      |                         ^~~
      |                         abs
a.cc:14:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<algorithm>
using namespace std;
const int maxn = 1e5+5;
char s[maxn];
struct node
{
    int st, sum;
}p;
int main()
{
    int k;
    int i;
    int len;
    int flag = 1;
    gets(s);
    len = strlen(s);
    for(i = 0; i < len; i++)
    {
        if(flag)
        {
            if(s[i] == '1')
            {
                p.st = i;
                p.sum = 1;
                flag = 0;
            }
        }
        else
        {
            if(s[i] == '1')
            {
                p.sum++;
            }
        }
    }
    if(p.sum != 1)
    {
        printf("%d\n", p.sum);
    }
    else
    {
        if(p.st != 0&&p.st != len-1)
            printf("%d\n", max(p.st, (len-p.st)));
        else
            printf("%d\n", len-1);
    }
    return 0;
}


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

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

string s;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> s;
  int ans = INF;
  FOR(i, 1, s.size()) {
    if (s[i] != s[i - 1])
      ans = min(ans, s.size() - i);
  }
  
  cout << ans << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:16: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   39 |       ans = min(ans, s.size() - i);
      |             ~~~^~~~~~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:39:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   39 |       ans = min(ans, s.size() - i);
      |             ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:39:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   39 |       ans = min(ans, s.size() - i);
      |             ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <string>
#include <vector>
using namespace std;
int main(){
int n,k,i;
string S;
cin >> S;
n = S.size();
	vector<int> num;
	for(k=0;k<n;k++){
		num.push_back(S[k]-'0');
	}
	if(n%2==0){
		if(num[n/2-1]==1 && num[n/2]==1){
			for(k=n/2;k<n;k++){
				if(num[n-k-1]==0 || num[k]==0){
					i = k-1;
					break;
				}
				i=n;
			}
		}else if(num[n/2-1]==0 && num[n/2]==0){
			for(k=n/2;k<n;k++){
				if(num[n-k-1]==1 || num[k]==1){
					i = k-1;
					break;
				}
				i=n;
			}
		}else{
			i=n/2;
		}
	}else{
		if(num[n/2]==1){
			for(k=(n-1)/2;k<n;k++){
				if(num[n-k-1]==0 || num[k]==0){
					i=k;
					break;
				}
			i=n;
			}
		}else{
			for(k=(n-1)/2;k<n;k++){
				if(num[n-k-1]==1 || num[k]==1){
					i=k-1;
					break;
				}
			i=n;
			}
			}

	}
cout << i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope
    7 | cin >> S;
      | ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <vector>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:53:1: error: 'cout' was not declared in this scope
   53 | cout << i << endl;
      | ^~~~
a.cc:53:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:53:14: error: 'endl' was not declared in this scope
   53 | cout << i << endl;
      |              ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <vector>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

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

int main() {
  string s;
  cin >> s;
  int k = s.length();
  for (int i = 0; i + 1 < s.length(); i++) {
    if (s[i] != s[i+1]) {
      k = min(k, max(i + 1, s.length() - i - 1));
    }
  }
  cout << k << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: no matching function for call to 'max(int, std::__cxx11::basic_string<char>::size_type)'
   12 |       k = min(k, max(i + 1, s.length() - i - 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:12:21: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   12 |       k = min(k, max(i + 1, s.length() - 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,
                 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:12:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   12 |       k = min(k, max(i + 1, s.length() - i - 1));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
//#include<cmath>
//#include<algorithm>
//#include<cstring>
//#include<map>
using namespace std;
char s[101];
int main()
{
	gets(s);
	int ans=0;
	for(int i=1;i<=strlen(s);i++)
	    if(s[i]=='0')ans++;
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |         gets(s);
      |         ^~~~
      |         getw
a.cc:13:24: error: 'strlen' was not declared in this scope
   13 |         for(int i=1;i<=strlen(s);i++)
      |                        ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdio>
  +++ |+#include <cstring>
    3 | //#include<cmath>
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define con continue
#define bk break
#define LL long long
#define db double
#define pt cout<<'\n'
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
LL inf=2147483647;const long long ll =9223372036854775807,ninf=1000000000;const double eps = 1e-6; const long long nll =1000000000000000000;
#define sz size()
#define len(X) strlen(X)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ULL unsigned long long
#define de cout<<"test"<<endl;
#define st system("pause");
#define F first
#define S second
class MagicNumberThree
{

    public:
int countSubsequences(string s)
{

}

};


int main()
{
    string a;
    while(cin>>a){
        int cnt=0;
        for(int i=0;i<a.sz;i++){
            if(a[i]=='1')
                cnt++;
        }
        int n=a.sz;
        ans=max(n-cnt,cnt);
        
        
        cout<<ans<<endl;
        
        
        
        
        
    }
    return 0;
}


Compiler output:
a.cc: In member function 'int MagicNumberThree::countSubsequences(std::string)':
a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
a.cc: In function 'int main()':
a.cc:42:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |         ans=max(n-cnt,cnt);
      |         ^~~
      |         abs
Language: C++

#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
char ch[1001010];
int a[3], cnt[3][100100];
int stu(char xx) {
    if(xx == '0')
        return 0;
    else if(xx == '1')
        return 1;
    return 2;
 }
int main(){
    scanf("%s", ch+1);
    ch[0] = 'x';
    int ans = 0;
    int cnt = 0, p = 0;
    for(int i = 1; ch[i-1] || !(i-1); i ++){
        if(ch[i] != ch[i-1]){
            if(p == 0)
                cnt[p][x] = max(cnt, cnt[p][x-1]);
            else
                cnt[p][x] = max(cnt, cnt[p]);
            cnt = 1;
            p = stu(ch[i]);
            a[p] ++;
        }
        else
            cnt ++;
    }
    if(a[1] + a[0] <= 2)
        printf("%d", max(cnt1, cnt2));
    else
        printf("%d", cnt1 + cnt2);
    //printf("\n%d %d\n", cnt1, cnt2);
    //printf("\n%d %d\n", a[0], a[1]);
} 

Compiler output:
a.cc:38:3: error: extended character  is not valid in an identifier
   38 | } 
      |   ^
a.cc: In function 'int main()':
a.cc:22:20: error: invalid types 'int[int]' for array subscript
   22 |                 cnt[p][x] = max(cnt, cnt[p][x-1]);
      |                    ^
a.cc:22:24: error: 'x' was not declared in this scope
   22 |                 cnt[p][x] = max(cnt, cnt[p][x-1]);
      |                        ^
a.cc:22:41: error: invalid types 'int[int]' for array subscript
   22 |                 cnt[p][x] = max(cnt, cnt[p][x-1]);
      |                                         ^
a.cc:24:20: error: invalid types 'int[int]' for array subscript
   24 |                 cnt[p][x] = max(cnt, cnt[p]);
      |                    ^
a.cc:24:24: error: 'x' was not declared in this scope
   24 |                 cnt[p][x] = max(cnt, cnt[p]);
      |                        ^
a.cc:24:41: error: invalid types 'int[int]' for array subscript
   24 |                 cnt[p][x] = max(cnt, cnt[p]);
      |                                         ^
a.cc:33:26: error: 'cnt1' was not declared in this scope; did you mean 'cnt'?
   33 |         printf("%d", max(cnt1, cnt2));
      |                          ^~~~
      |                          cnt
a.cc:33:32: error: 'cnt2' was not declared in this scope; did you mean 'cnt'?
   33 |         printf("%d", max(cnt1, cnt2));
      |                                ^~~~
      |                                cnt
a.cc:35:22: error: 'cnt1' was not declared in this scope; did you mean 'cnt'?
   35 |         printf("%d", cnt1 + cnt2);
      |                      ^~~~
      |                      cnt
a.cc:35:29: error: 'cnt2' was not declared in this scope; did you mean 'cnt'?
   35 |         printf("%d", cnt1 + cnt2);
      |                             ^~~~
      |                             cnt
a.cc: At global scope:
a.cc:38:3: error: '\U0000f09c' does not name a type
   38 | } 
      |   ^
Language: C++

#include<bits/stdc++.h>
int main(){
    int n,s;
    cin >> s;
    n = s.size();
    int answer = n;
    for (int i = 1; i < n; i++)
    if (s[i] != s[i - 1])
        answer = min(answer, max(i, n - i));
    cout << answer;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin >> s;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:11: error: request for member 'size' in 's', which is of non-class type 'int'
    5 |     n = s.size();
      |           ^~~~
a.cc:8:10: error: invalid types 'int[int]' for array subscript
    8 |     if (s[i] != s[i - 1])
      |          ^
a.cc:8:18: error: invalid types 'int[int]' for array subscript
    8 |     if (s[i] != s[i - 1])
      |                  ^
a.cc:9:30: error: 'max' was not declared in this scope; did you mean 'std::max'?
    9 |         answer = min(answer, max(i, n - i));
      |                              ^~~
      |                              std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:9:18: error: 'min' was not declared in this scope; did you mean 'std::min'?
    9 |         answer = min(answer, max(i, n - i));
      |                  ^~~
      |                  std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout << answer;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~