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

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

int ans=1e9+7;

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

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

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

#define fr(i,n) _back
#define pb	push_back
#define eb	emplace_back
#define mk	make_pair
#define fi	first
#define se	second
#define endl	'\n'

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);

int main() {
    ios_base::sync_with_stdio(false);
    string s; cin >> s;
    int n = s.size();
    int ans = 0;
    for(int i = 0; i < n.size(); i++) ans += s[i] == '0';
    cout << max(ans,n-ans) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: request for member 'size' in 'n', which is of non-class type 'int'
   23 |     for(int i = 0; i < n.size(); i++) ans += s[i] == '0';
      |                          ^~~~
Language: C++

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

#define fr(i,n) _back
#define pb	push_back
#define eb	emplace_back
#define mk	make_pair
#define fi	first
#define se	second
#define endl	'\n'

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);

int main() {
    ios_base::sync_with_stdio(false);
    string s; cin >> s;
    int ans = 0;
    for(int i = 0; i < s.size(); i++) ans += s[i] == '0';
    cout << max(ans,n-ans) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: 'n' was not declared in this scope
   23 |     cout << max(ans,n-ans) << endl;
      |                     ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){if(DEBUG_OUT == false)return;std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == 1)return;for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(vector<int>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}


void solve(void)
{  
  string str;
  cin>>str;

  int ANS = INF;
  string str_zero(str.size(),'0');
  string str_one(str.size(),'1');
  
  if(str == str_zero) ANS = 0;
  fi(str == str_one ) ANS = str.size();

  for (int i = 0; i < str.size()-1; i++)
  {
    if(str[i] != str[i+1]) chmin(ANS,max(i+1,(int)str.size()-i-1));
  }
  cout<<ANS<<endl;
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:57:3: error: 'fi' was not declared in this scope
   57 |   fi(str == str_one ) ANS = str.size();
      |   ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
string s;
int ans=99999999;
int main(){
	cin>>s;
	for(int i=1;i<s.length();i++){
		if(s[i]!=s[i-1])
		ans=min(ans,max(i,int(s.length())-i));
	}
	cout<<min(ans,int(s.length());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:38: error: expected ')' before ';' token
   11 |         cout<<min(ans,int(s.length());
      |                  ~                   ^
      |                                      )
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;


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

Compiler output:
a.cc: In function 'int main()':
a.cc:23:48: error: 'n' was not declared in this scope
   23 |         if(s[i]!=s[i+1]) ans = min(ans,max(i+1,n-i-1));
      |                                                ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int nadjiX(string s,int n)
{
    for(int i=n/2;i<n-1;i++)
        if(s[i]!=s[i+1])return i;
    return -1;
}

int nadjiY(string s,int n)
{
    for(int i=n/2;i>0;i--)
        if(s[i]!=s[i-1])return i;
    return -1;
}


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

    string s;
    cin>>s;
    int n=s.size();

    int x=nadjiX(s,n);
    int y=nadjiY(s,n);
    if(abs(n/2-x)<abs(n/2-y))
        cout<<max(x,(n-x));
    else cout<<max(y,n-y);

    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: expected '}' at end of input
   35 |     return 0;
      |              ^
a.cc:21:1: note: to match this '{'
   21 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#include<cmath>
using namespace std;
string s;
long long a,b,n,i;
int main(){
cin>>s;
n=s.size()
for(i=0;i<n;++i){
	if(s[i]=='1') ++a;
	if(s[i]=='0') ++b;
}
cout<<max(a,b);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected ';' before 'for'
    8 | n=s.size()
      |           ^
      |           ;
    9 | for(i=0;i<n;++i){
      | ~~~        
a.cc:9:16: error: expected ';' before ')' token
    9 | for(i=0;i<n;++i){
      |                ^
      |                ;
Language: C

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

using ll = long long;
#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 REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define sz(v) (int)v.size()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
const char EOL = '\n';

void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    string s;
    cin >> s;
    vector<int> sum;
    int p = '*';
    int n = 0;
    REPS(c, s) {
        if (c != p) {
            sum.emplace_back(n);
            n = 1;
        } else {
            n++;
        }
        p = c;
    }
    sum.emplace_back(n);

    int m = sz(sum);
    int ans= max(sum[1], sum[m - 1]);
    FOR(i, 2, m - 1) {
        chmax(ans, sum[i] + 1);
    }
    cout << ans << EOL;
}


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

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int ans=1<<30;
char s[100001];
int main(){
    cin>>s;
    for(int i=1;i<strlen(s);i++)
        if(s[i]!=s[i-1])
            ans=min(ans,max(i,strlen(s)-i));
    printf("%d\n",min(ans,int(strlen(s))));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: no matching function for call to 'max(int&, size_t)'
   11 |             ans=min(ans,max(i,strlen(s)-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:11:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'size_t' {aka 'long unsigned int'})
   11 |             ans=min(ans,max(i,strlen(s)-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
Language: C++

#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007;
using ll = long long;
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:54: error: expected ';' before ')' token
   14 |                         ans = min(ans, max(i, n-i+1)));
      |                                                      ^
      |                                                      ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    string a; 
    int minn = 214748364; 
    cin >> a;
    for (int i = 1; i < a.size(); i++) if (a[i] != a[i - 1]) minn = min(max(a.size() - i, i), minn);
    if (minn < a.size()) printf("%d\n", minn); else printf("%d\n", a.size());
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main() {
    string a; int minn = 2147483646; cin >> a;
    for (int i = 1; i < a.size(); i++) if (a[i] != a[i - 1]) minn = min(max(a.size() - i, i), minn);
    if (minn < a.size()) printf("%d\n", minn); else printf("%d\n", a.size());
    return 0;
}

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

#include <iostream>

using namespace std;

int main(){
    string s;
    cin>>s;
    bool ok = true;
    s = " "+s;
    int ans = 1e9;
    
  
    for(int i=2;i<(int)s.length();i++){
        if(s[i]!=s[i-1]){
            ans = min(ans,max(i-1,(int)s.length()-i));
        }
    }
    if(ans == 1e9){
        cout<<n<<endl;
        return 0;
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: 'n' was not declared in this scope
   19 |         cout<<n<<endl;
      |               ^
Language: C++


  //In The Name Of GOD

#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
const ll mod = 998244353;
const ll inf = 2000000000;
const ll infll = (ll)2*1000*1000*1000*1000*1000*1000;
const ll maxn = 100*1000+1;
#define pb push_back
#define pp pop_back
#define X first
#define Y second
#define IO ios_base::sync_with_stdio(false);

int main(){
  IO;
  string s;
  int ans=0;
  cin>>s;
  for(int i=0;i<s.size();i++){
    ans+=s[i]-'0';
  }
  cout<<max(s.size()-ans, ans);
}


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

#include <bits/stdc++.h>
int main() {
    std::string a; int minn = 2147483646; std::cin >> a;
    for (int i = 0; i < a.size() - 1; i++) if (a[i] != a[i + 1]) minn = std::min(std::max(a.size() - i - 1, i + 1), minn);
    if (minn < a.size()) printf("%d\n", minn); else printf("%d\n", a.size());
    return 0;
}

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

#include <bits/stdc++.h>
int main() {
    std::string a; int minn = 2147483646; std::cin >> a;
    for (int i = 0; i < a.size() - 1; i++) if (a[i] != a[i + 1] && max(a.size() - i - 1, i + 1)) minn = max(a.size() - i - 1, i + 1);
    if (ans < a.size()) printf("%d\n", ans); else printf("%d\n", a.size());
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:68: error: 'max' was not declared in this scope; did you mean 'std::max'?
    4 |     for (int i = 0; i < a.size() - 1; i++) if (a[i] != a[i + 1] && max(a.size() - i - 1, i + 1)) minn = max(a.size() - i - 1, i + 1);
      |                                                                    ^~~
      |                                                                    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,
                 from a.cc:1:
/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:5:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    5 |     if (ans < a.size()) printf("%d\n", ans); else printf("%d\n", a.size());
      |         ^~~
      |         abs
Language: C++

#include <iostream>
#include <fstream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <string>
#include <iomanip>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
using namespace std;
typedef long long ll;



int main(){
	
	string s; cin >> s;
	int n = s.size();
	
	int cnt0 = 0, cnt1 = 0;
	for(int i=0; i<n; i++){
		if(s[i] == '1') cnt1++;
		else cnt0++;
	}
	
	cout << max(cnt1, cnt2) << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:27: error: 'cnt2' was not declared in this scope; did you mean 'cnt1'?
   32 |         cout << max(cnt1, cnt2) << endl;
      |                           ^~~~
      |                           cnt1
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
using namespace std;

int main()
{
    char a[100005];
    gets(a);
    int l=strlen(a);
    int i;
    bool flag;
    int op=0x3fffffff;
    int max1;
    for( i=0;i<l-1;i++)
    {
        if(a[i]!=a[i+1])
        {
        if(i+1>=l-i-2)
          {
               flag=1;
               max1=i+1;
          }
        else
        {

          flag=0;
           max1=l-i-1;
        }
        op=op>max1?max1:op;
       if(flag)
       {
           if(a[i+1]=='1')
           for(int j=0;j<max1;j++)
              a[j]='1';
            else
            for(int j=0;j<max1;j++)
              a[j]='0';
       }
    else
    {
        if(a[i+1]=='1')
           for(int j=i+1;j<l;j++)
              a[j]='1';
        else
             for(int j=i+1;j<l;j++)
              a[j]='0';
    }
    }
    }
    printf("%d\n",max1);
    return 0;
}


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

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

using namespace std;

int main()
{
    char a[100005];
    gets(a);
    int l=strlen(a);
    int i;
    bool flag;
    int op=0x3fffffff;
    int max1;
    for( i=0;i<l-1;i++)
    {
        if(a[i]!=a[i+1])
        {
        if(i+1>=l-i-2)
          {
               flag=1;
               max1=i+1;
          }
        else
        {

          flag=0;
           max1=l-i-1;
        }
        op=op>max1?max1:op;
       if(flag)
       {
           if(a[i+1]=='1')
           for(int j=0;j<max1;j++)
              a[j]='1';
            else
            for(int j=0;j<max1;j++)
              a[j]='0';
       }
    else
    {
        if(a[i+1]=='1')
           for(int j=i+1;j<l;j++)
              a[j]='1';
        else
             for(int j=i+1;j<l;j++)
              a[j]='0';
    }
    }
    }
    printf("%d\n",max1);
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
string S;
int k[1000000]={0};
int main()
{
    while(cin>>S)
    { long int len=S.size();
    int i=0,j;
    int count=0;
    for(j=1;j<len;j++)
     if(S[j]!=S[j-1])
        {
            k[count++]=max(j,len-j);
           // cout<<k[]
        }
    sort(k,k+count);
    cout<<k[count-1]<<endl;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: no matching function for call to 'max(int&, long int)'
   14 |             k[count++]=max(j,len-j);
      |                        ~~~^~~~~~~~~
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:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   14 |             k[count++]=max(j,len-j);
      |                        ~~~^~~~~~~~~
/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:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |             k[count++]=max(j,len-j);
      |                        ~~~^~~~~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include<iostream>
using namespace std;
string S;
int k[1000000]={0};
int main()
{
    while(cin>>S)
    { long int len=S.size();
    int i=0,j;
    int count=0;
    for(j=1;j<len;j++)
     if(S[j]!=S[j-1])
        {
            k[count++]=max(j,len-j);
           // cout<<k[]
        }
    sort(k,k+count);
    cout<<k[count-1]<<endl;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: no matching function for call to 'max(int&, long int)'
   17 |             k[count++]=max(j,len-j);
      |                        ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:3:
/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:17:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   17 |             k[count++]=max(j,len-j);
      |                        ~~~^~~~~~~~~
/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:17:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |             k[count++]=max(j,len-j);
      |                        ~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;

int ans = INF;
char s[100010];

int main() {
    scanf("%s", s);
    for (int i = 1; i < strlen(s); ++i) {
    	if (s[i] != s[i - 1]) ans = min(ans, max(i, (int)(strlen(s) - i)); 
    }
    printf("%d\n", min(ans, (int)(strlen(s))));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:74: error: expected ')' before ';' token
   11 |         if (s[i] != s[i - 1]) ans = min(ans, max(i, (int)(strlen(s) - i));
      |                                        ~                                 ^
      |                                                                          )
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {

	string s;
	cin >> s >> ;

	int counter = 0;
	int maxcount = 0;
	for (int i = 1; i < s.size(); i++) {
		if (s[i] == s[i - 1]) {
			counter++;
			maxcount = max(maxcount, counter);
		}
	}

	maxcount = max(2, maxcount);
	cout << maxcount << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: expected primary-expression before ';' token
    8 |         cin >> s >> ;
      |                     ^
Language: C++

#include <bits/stdc++.h> using namespace std; int main(void){ string S;cin>>S;int N=S.size(),m=N,i;for(i=1;i<N;++i)if(S[i-1]!=S[i])m=min(m, max(i,N-i));cout<<m<<endl;}


Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h> using namespace std; int main(void){ string S;cin>>S;int N=S.size(),m=N,i;for(i=1;i<N;++i)if(S[i-1]!=S[i])m=min(m, max(i,N-i));cout<<m<<endl;}
      |                          ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
int main(void){
  string S;std::cin >> S;
  int N = S.length(),m=N;
  for(int i = 1; i<N;++i) if(S[i-1]!=S[i]) m = min(m, max(i,N-i));
  std::cout << m << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string S;std::cin >> S;
      |   ^~~~~~
a.cc:3:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:3:24: error: 'S' was not declared in this scope
    3 |   string S;std::cin >> S;
      |                        ^
a.cc:5:44: error: 'm' was not declared in this scope
    5 |   for(int i = 1; i<N;++i) if(S[i-1]!=S[i]) m = min(m, max(i,N-i));
      |                                            ^
a.cc:5:55: error: 'max' was not declared in this scope; did you mean 'std::max'?
    5 |   for(int i = 1; i<N;++i) if(S[i-1]!=S[i]) m = min(m, 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:5:48: error: 'min' was not declared in this scope; did you mean 'std::min'?
    5 |   for(int i = 1; i<N;++i) if(S[i-1]!=S[i]) m = min(m, 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:6:16: error: 'm' was not declared in this scope
    6 |   std::cout << m << endl;
      |                ^
a.cc:6:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   std::cout << m << endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
string a;
int ans=1<<30; 
int main()
{
    cin>>a;
    for(int i=1;i<a.size();i++)
    {
        if(a[i]!=a[i-1])
            ans=min(ans,max(i,int(a.size())-i)); 
    }      
    cout<<min(ans,int(s.size()))<<endl; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: 's' was not declared in this scope
   13 |     cout<<min(ans,int(s.size()))<<endl;
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
string a;
int x;
int main()
{
	cin>>a;
	for(inti=0;i<a.size();i++)
	{
		if(a[i]=='0')x++;
	}
	cout<<x;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'inti' was not declared in this scope; did you mean 'int'?
    8 |         for(inti=0;i<a.size();i++)
      |             ^~~~
      |             int
a.cc:8:20: error: 'i' was not declared in this scope
    8 |         for(inti=0;i<a.size();i++)
      |                    ^
Language: C++

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

string a;
int sum=9999999;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: invalid operands of types 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |         cout<<min(sum,int(a.length()<<endl;
      |                           ~~~~~~~~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;

string a;
int sum=0x7fffffff;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: invalid operands of types 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and '<unresolved overloaded function type>' to binary 'operator<<'
   14 |         cout<<min(sum,int(a.length()<<endl;
      |                           ~~~~~~~~~~^~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'n' was not declared in this scope
    7 |     int i, m = n = (int)s.length();
      |                ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'a' was not declared in this scope
   13 |     cout << a;
      |             ^
Language: C++

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

int main(){
    int i, m = 100000;
    char c = '2';
    string s;
    cin >> s;
    for(i=0; i<s.length(); i++){
        if(c != s[i]){
            c = s[i];
            m = min(m, min(i+1, s.length()-i-1));
        }
    }
    cout << a;
    return 0;
}

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

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

int main(){
    int i, m = 100000;
    char c = '2';
    string s;
    cin >> s;
    for(i=0; i<s.length(); i++){
        if(c != s[i]){
            c = s[i];
            m = min(m, min(i+1, s.length()-i-1))
        }
    }
    cout << a;
    return 0;
}

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

#include <cstring>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

unordered_map<ll, ll> mp;


int main() {
#ifdef MY_DEBUG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
    while (true) {
        mp = unordered_map<ll, ll>();
#pragma clang diagnostic pop
#endif
        string s;
        cin >> s;
        ll ans = 0;
        rep(i, s.size() - 1) {
            if (s[i] != s[i + 1]) {
                ans = min(ans, max(i + 1, ll(s.size() - i - 1));
            }
        }
        cout << ans << endl;

#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:64: error: expected ')' before ';' token
   43 |                 ans = min(ans, max(i + 1, ll(s.size() - i - 1));
      |                          ~                                     ^
      |                                                                )