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

#include<bits/stdc++.h>
#include<string.h>
#include<map>
#include<unordered_map>
using namespace std;
int main()
{
    string s;
    cin>>s;
    long long cnt=0;
    for(long long i=0;i<s.size();i++)
    {
        if(s[i]=='0'&&s[i+1]=='0')
        {
            s[i+1]='1';
            cnt++;
        }
        else if(s[i]=='1'&&s[i+1]=='1')
        {
            s[i+1]='0';
            cnt++;
        }
    }
    cout<<min(s.size()-cnt,cnt);
    return 0;
}


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

#include<bits/stdc++.h>
#include<string.h>
#include<map>
#include<unordered_map>
using namespace std;
main()
{
    string s;
    cin>>s;
    long long cnt=0;
    for(long long i=0;i<s.size();i++)
    {
        if(s[i]=='0'&&s[i+1]=='0')
        {
            s[i+1]='1';
            cnt++;
        }
        else if(s[i]=='1'&&s[i+1]=='1')
        {
            s[i+1]='0';
            cnt++;
        }
    }
    cout<<min(s.size()-cnt,cnt);
    return 0;
}


Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:24:14: error: no matching function for call to 'min(long long unsigned int, long long int&)'
   24 |     cout<<min(s.size()-cnt,cnt);
      |           ~~~^~~~~~~~~~~~~~~~~~
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:24:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'long long int')
   24 |     cout<<min(s.size()-cnt,cnt);
      |           ~~~^~~~~~~~~~~~~~~~~~
/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:24:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   24 |     cout<<min(s.size()-cnt,cnt);
      |           ~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	fastio
	string s;
	cin>>s;
	int cnt1=0;
	for(int i=0;i<s.size();++i){
		if(i&1 && s[i]!='0') ++cnt1;
		else if(i%2==0 && s[i]!='1') ++cnt1; 
	}
	int cnt2=0;
	for(int i=0;i<s.size();++i){
		if(i&1 && s[i]!='1') ++cnt2;
		else if(i%2==0 && s[i]!='0') ++cnt2;
 	}
 	//cout<<cnt1<<" "<<cnt2<<'\n';
 	cout<<min(cnt1,cnt2);
	return 0;
}#include<bits/stdc++.h>
using namespace std;
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	fastio
	string s;
	cin>>s;
	int cnt1=0;
	for(int i=0;i<s.size();++i){
		if(i&1 && s[i]!='0') ++cnt1;
		else if(i%2==0 && s[i]!='1') ++cnt1; 
	}
	int cnt2=0;
	for(int i=0;i<s.size();++i){
		if(i&1 && s[i]!='1') ++cnt2;
		else if(i%2==0 && s[i]!='0') ++cnt2;
 	}
 	//cout<<cnt1<<" "<<cnt2<<'\n';
 	cout<<min(cnt1,cnt2);
	return 0;
}

Compiler output:
a.cc:25:2: error: stray '#' in program
   25 | }#include<bits/stdc++.h>
      |  ^
a.cc:25:3: error: 'include' does not name a type
   25 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:28:5: error: redefinition of 'int main()'
   28 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int AA=0;
  int BB=0;
  string S;
  cin>>S;
  vector<int>A(S.size());
  for(int X=0;X<S.size();X++){
    if(X%2=0){
      A.at(X)=1;
    }
    else{
      A.at(X)=0;
    }
  }
  for(int X=0;X<S.size();X++){
    if(S.at(X)==A.at(X)){
      AA++;
    }
    else{
      BB++;
    }
  }
  if(AA>=BB){
    cout<<BB<<endl;
  }
  else{
    cout<<AA<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: lvalue required as left operand of assignment
   11 |     if(X%2=0){
      |        ~^~
Language: C++


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    string s;
    cin >> s;
    int blackstart=0;
    int whitestart=0;
    int n=s.size();
    for(int i=0; i<n; i++){
        //黒であるべきところが白だったら
        if(i%2==0 && s[i]==1){
            blackstart ++;
        }
        if(i%2==1 && s[i]==0){
            blackstart ++;
        }
    }
    for(int i=0; i<n; i++){
        if(i%2==1 && s[i]==1){
            whitestart start ++;
        }
        if(i%2==0 && s[i]==0){
            whitestart ++;
        }
    }
    int ans = min(blackstart,whitestart);
    cout << ans << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: expected ';' before 'start'
   26 |             whitestart start ++;
      |                       ^~~~~~
      |                       ;
Language: C++


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    string s;
    cin >> s;
    int blackstart=0;
    int whitestart=0;
    for(int i=0; i<s.size(); i++){
        //黒であるべきところが白だったら
        if(i%2==0 && s[i]==1){
            blackstart ++;
        }
        if(i%2==1 && s[i]==0){
            blackstart ++;
        }
    }
    for(int i=0; i<s.size(); i++){
        if(i%2==1 && s[i]==1){
            whitestart start ++;
        }
        if(i%2==0 && s[i]==0){
            whitestart ++;
        }
    }
    int ans = min(blackstart,whitestart);
    cout << ans << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: expected ';' before 'start'
   25 |             whitestart start ++;
      |                       ^~~~~~
      |                       ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  string s;
  cin>>s;
  int ans=999999;
  rep(i,2){
    int cnt=0;
    rep(j,s.size()){
      if(j%2==0 && s[i]==(char)(i+'0')
         cnt++;
      if(j%2==1 && s[i]!=(char)(i+'0')
         cnt++;
    }
    ans=min(ans,cnt);
  }
  cout<<ans<<endl;
         }
              

Compiler output:
a.cc: In function 'int main()':
a.cc:25:39: error: expected ';' before 'cnt'
   25 |       if(j%2==0 && s[i]==(char)(i+'0')
      |                                       ^
      |                                       ;
   26 |          cnt++;
      |          ~~~                           
a.cc:27:7: error: expected primary-expression before 'if'
   27 |       if(j%2==1 && s[i]!=(char)(i+'0')
      |       ^~
a.cc:26:16: error: expected ')' before 'if'
   26 |          cnt++;
      |                ^
      |                )
   27 |       if(j%2==1 && s[i]!=(char)(i+'0')
      |       ~~        
a.cc:25:9: note: to match this '('
   25 |       if(j%2==0 && s[i]==(char)(i+'0')
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int n;
  cin>>n;
  string s;
  cin>>s;
  string a;
  int ans=s.size();
  rep(i,2){
    int cnt=0;
    rep(j,s.size()){
     if(j%2==0 && s[j]!=(char)(i+'0')){
       //char(i+'0')で数字文字列が変わる
       //'0'+1=='1' etc...
      cnt++;
     }
     if(j%2==1 && s[j]==(char)(i+'0')){
       cnt++;
     }
    }
    res=min(ans,cnt);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'res' was not declared in this scope; did you mean 'rep'?
   37 |     res=min(ans,cnt);
      |     ^~~
      |     rep
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int n;
  cin>>n;
  string s;
  cin>>s;
  string a;
  int ans=s.size();
  rep(i,2){
    int cnt=0;
    rep(j,s.size()){
     if(j%2==0 && s[j]!=(char)(i+'0')){
       //char(i+'0')で数字文字列が変わる
       //'0'+1=='1' etc...
      cnt++;
     }
     if(j%2==1 && s[j]==(char)(i+'0')){
       cnt++;
    }
    res=min(ans,cnt);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'res' was not declared in this scope; did you mean 'rep'?
   36 |     res=min(ans,cnt);
      |     ^~~
      |     rep
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:18:17: note: to match this '{'
   18 | int main()      {
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int n;
  cin>>n;
  string s;
  cin>>s;
  string a;
  int ans=s.size();
  res=99999;
  rep(i,2){
    int cnt=0;
    rep(j,s.size()){
     if(j%2==0 && s[i]==(char)(i+'0'))
      cnt++;
    }
    ans-=cnt;
    res=min(ans,res);
  }
  cout<<res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: 'res' was not declared in this scope; did you mean 'rep'?
   25 |   res=99999;
      |   ^~~
      |   rep
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int n;
  cin>>n;
  string str,s,t;
  cin>>str;
  s[0]=0,t[0]=1;
  rep(i,n-1){
    if(s[i]==0){
      s[i+1]=1;
      t[i+1]=0;
    }
    else{
      s[i+1]=0;
      t[i+1]=1;
    }
  }
  int a,b;
  rep(i,n){
    if(str[i]!=s[i])
      a++;
    else
      b++;
  }
  int ans=min(a,b);
  cout<<ans<<endl;
}
      
  
}

Compiler output:
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

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

int main(){
  int ans = 0;
  string s ;
  cin >> s ;
  int ss = s.size();
  
  for(int i=0;i<N-1;i++){
    if(s[i]=='0'&&s[i+1]=='0'){
      ans++;
      s[i+1] = '1';
    }
    if(s[i]=='1'&&s[i+1]=='1'){
      ans++;
      s[i+1]='0';
    }
  }
  
  cout << ans << endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'N' was not declared in this scope
   10 |   for(int i=0;i<N-1;i++){
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll/*, vl, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, n) for(ll i = 1; i <= ll(n); i++)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

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

  string s;
  cin >> s;
  ll ans=0;
  rep(i, s.size()) if(i+s[i] & 1) ans++;
  cout << min(ans, s.size()-ans) << newl;
  return 0;
}


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

import java.util.*
import kotlin.math.*
import kotlin.collections.ArrayList
fun readint()=readLine()!!.toInt()
fun readll()=readLine()!!.toLong()
fun readstring()=readLine()!!
fun readlint()=(readLine()!!.split(" ").map{it.toInt()}).toIntArray()
fun readlll()=(readLine()!!.split(" ").map{it.toLong()}).toLongArray()

fun solve() {
    val s = readstring();
    var mi = s.length;
    var c = 0;
    for (i in 0 until s.length) {
        if (i % 2 == 0 && s[i] == '1') {
            c++;
        }
        if (i % 2 == 1 && s[i] == '0') {
            c++;
        }
    }
    mi = min(mi, c);
    c = 0;
    for (i in 0 until s.length) {
        if (i % 2 == 0 && s[i] == '0') {
            c++;
        }
        if (i % 2 == 1 && s[i] == '1') {
            c++;
        }
    }
    mi = min(mi, c);
    println(mi);
}
fun main(args: Array<String>) {
    val t = 1;
    repeat(t) {
        solve();
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:56: error: expected unqualified-id before ')' token
    7 | fun readlint()=(readLine()!!.split(" ").map{it.toInt()}).toIntArray()
      |                                                        ^
a.cc:8:56: error: expected unqualified-id before ')' token
    8 | fun readlll()=(readLine()!!.split(" ").map{it.toLong()}).toLongArray()
      |                                                        ^
a.cc:35:1: error: 'fun' does not name a type
   35 | fun main(args: Array<String>) {
      | ^~~
Language: Java

import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int n = s.length();

		boolean[] list0 = new boolean[n];
		boolean[] list1 = new boolean[n];
		int x  = 0;
		int xx = 1;

		for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		}

		int ans0 = 0;
		int ans1 = 0;

		for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		}

		System.out.println(Math.min(n - ans0, n - ans1));



	}

	public static boolean XOR(int x, int y) {

		if(x == y) {
			return true;
		}

		return false;
	}



Compiler output:
Main.java:59: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        Long dec = Long.parseLong(s, 2);


        Long count = 0l;
        for (int i = 0; i <= dec; i++) {
            if((dec | (1 << 1)) != 0) {
                dec /= 4;
                if (s.length() < 2) break;
                count++;
            }
        }

        System.out.println(count);
    }
}


Compiler output:
Main.java:4: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 0;
        int count = 0;
        for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=="0")||(i%2==1 && s.charAt(i)=="1")){count++;}}
        ans = Math.min(count,s.length());
		System.out.println(ans);
  }
}

Compiler output:
Main.java:9: error: bad operand types for binary operator '=='
          if((i%2==0 && s.charAt(i)=="0")||(i%2==1 && s.charAt(i)=="1")){count++;}}
                                   ^
  first type:  char
  second type: String
Main.java:9: error: bad operand types for binary operator '=='
          if((i%2==0 && s.charAt(i)=="0")||(i%2==1 && s.charAt(i)=="1")){count++;}}
                                                                 ^
  first type:  char
  second type: String
2 errors
Language: C++

s =list(input())
count =0
for i in range(1,len(s)):
    if s[i-1] ==s[i]:
        count +=1
        if s[i] =='0':
            s[i] ='1'
        else:
            s[i] ='0'
print(count)

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s =list(input())
      | ^
Language: Java

public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        char[] charArray = input.toCharArray();
        int length = charArray.length;

        char[] shiroKuro = new char[length];
        char[] kuroShiro = new char[length];
        for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        }

        int shiroKuroCount = 0;
        int kuroShiroCount = 0;

        for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        }

        System.out.println(Math.min(shiroKuroCount, kuroShiroCount));
    }

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) throws Exception {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

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

int main() {
  string S;
  cin >>S;
  int N = S.size()
  int a=0,b=0;
  for(int i=0;i < N;i++){
    if(i%2 == 0){
      if(S[i] == '0'){
        S[i] = '1'
        a++;
      }
    }
    else{
      if(S[i] == '1'){
        S[i] = '0'
        a++;
      }
    } 
  }
  for(int j=0;j < N;j++){
    if(j%2 == 0){
      if(S[j] == '1'){
        S[j] = '0'
        b++;
      }
    }
    else{
      if(S[j] == '0'){
        S[j] = '1'
        b++;
      }
    } 
  }
  cout << min(a,b) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'int'
    8 |   int a=0,b=0;
      |   ^~~
a.cc:12:19: error: expected ';' before 'a'
   12 |         S[i] = '1'
      |                   ^
      |                   ;
   13 |         a++;
      |         ~          
a.cc:18:19: error: expected ';' before 'a'
   18 |         S[i] = '0'
      |                   ^
      |                   ;
   19 |         a++;
      |         ~          
a.cc:26:19: error: expected ';' before 'b'
   26 |         S[j] = '0'
      |                   ^
      |                   ;
   27 |         b++;
      |         ~          
a.cc:32:19: error: expected ';' before 'b'
   32 |         S[j] = '1'
      |                   ^
      |                   ;
   33 |         b++;
      |         ~          
a.cc:37:15: error: 'a' was not declared in this scope
   37 |   cout << min(a,b) << endl;
      |               ^
a.cc:37:17: error: 'b' was not declared in this scope
   37 |   cout << min(a,b) << endl;
      |                 ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'string' was not declared in this scope
    2 |     string s; cin >> s;
      |     ^~~~~~
a.cc:2:15: error: 'cin' was not declared in this scope
    2 |     string s; cin >> s;
      |               ^~~
a.cc:2:22: error: 's' was not declared in this scope
    2 |     string s; cin >> s;
      |                      ^
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout << min(cnt1,cnt2) << endl;
      |     ^~~~
a.cc:16:13: error: 'min' was not declared in this scope; did you mean 'main'?
   16 |     cout << min(cnt1,cnt2) << endl;
      |             ^~~
      |             main
a.cc:16:31: error: 'endl' was not declared in this scope
   16 |     cout << min(cnt1,cnt2) << endl;
      |                               ^~~~
Language: C

#include<stdio.h>

int main() {
  int N[100000]
  int i = 1;
  int anscnt = 0;
  int n;
  n = getchar();
  N[0] = n;
  while(n == NULL){
    n = getchar();
    if(N[i - 1] != n){
      N[i] = n;
    } else {
      anscnt ++;
      if(n == 1){
        n = 0;
      } else {
        n = 1;
      }
      N[i] = n;
    }
  }
  printf("%d", anscnt);
}


Compiler output:
main.c: In function 'main':
main.c:4:16: error: expected ';' before 'int'
    4 |   int N[100000]
      |                ^
      |                ;
    5 |   int i = 1;
      |   ~~~           
main.c:9:3: error: 'N' undeclared (first use in this function)
    9 |   N[0] = n;
      |   ^
main.c:9:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:11: warning: comparison between pointer and integer
   10 |   while(n == NULL){
      |           ^~
Language: C

#include<stdio.h>

int main() {
  int N[100000]
  int i = 1;
  int anscnt = 0;
  int n;
  n = getchar();
  N[0] = n;
  while(n == NULL){
    n = getchar();
    if(N[i - 1] != n){
      N[i] == n;
    } else {
      anscnt ++;
      if(n == 1){
        n = 0;
      } else {
        n = 1;
      }
      N[i] == n;
    }
  }
  printf("%d", anscnt);
}

Compiler output:
main.c: In function 'main':
main.c:4:16: error: expected ';' before 'int'
    4 |   int N[100000]
      |                ^
      |                ;
    5 |   int i = 1;
      |   ~~~           
main.c:9:3: error: 'N' undeclared (first use in this function)
    9 |   N[0] = n;
      |   ^
main.c:9:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:11: warning: comparison between pointer and integer
   10 |   while(n == NULL){
      |           ^~
Language: C

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

int main(){
  int cnt=0;
  char S[100000];
  scanf("%s",S);
  for(int i = 3;i < S.length-1;i++){
    if(s[i-1] == s[i] && s[i-2] == s[i]){
      cnt ++;
    }
  }
  printf("%d",cnt);
  
}

Compiler output:
main.c: In function 'main':
main.c:8:22: error: request for member 'length' in something not a structure or union
    8 |   for(int i = 3;i < S.length-1;i++){
      |                      ^
main.c:9:8: error: 's' undeclared (first use in this function)
    9 |     if(s[i-1] == s[i] && s[i-2] == s[i]){
      |        ^
main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
int main(){
  string s;
  cin >> s;
  
  int ans = s.length();
  
  //iは最初に使う色(0or1)
  for (int i=0;i<2;++i){
    //iを最初に使ったときに変えなければならないタイルの数
    int cnt = 0;
    
    for (int j=0;j<s.length();++j){
      //文字を数字に変換する方法((char)(0+'0')→'0')
      if (j%2==0&&s[j]!=(char)(i+'0')) cnt++;
      if (j%2==1&&s[j]==(char)(i+'0')) cnt++;
    }
    ans = min(ans,cnt);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string 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:4:3: 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:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:4:10: error: 's' was not declared in this scope
    4 |   cin >> s;
      |          ^
a.cc:18:11: error: 'min' was not declared in this scope; did you mean 'std::min'?
   18 |     ans = min(ans,cnt);
      |           ^~~
      |           std::min
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:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:20:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |   cout << ans << 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++

/*
 * atcoder/abc124_2nd/c.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

const int MAX = 100100;
string S;
int N;

int dp[MAX][2] = {0};

void solve() {
  cin >> S;
  N = S.size();
  loop(n,0,N+1) loop(i,0,2) acc[n][i] = 500000;

  for (int n=0; n<N; n++) {
    int d = S[n] - '0';
    if (n==0) {
      dp[0][0] = d==1;
      dp[0][1] = d==0;
      continue;
    }
    for (int i=0; i<2; i++) {
      dp[n+1][i] = dp[n][!i] + (d!=i);
    }
  }
  cout << min(dp[N][0], dp[N][1]) << endl;
}
int main() {
  // cout.precision(15);
  // cout << fixed << double

  solve();

  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:27:29: error: 'acc' was not declared in this scope
   27 |   loop(n,0,N+1) loop(i,0,2) acc[n][i] = 500000;
      |                             ^~~
Language: C++

using namespace std;


int main() {
	
	string a;
	int resp=0;
	cin>> a;
		
	for(int i=1;i<a.length();i++){
		if(i%2){
			if(a[0] == a[i]){
				resp++;
			}
		}else{
			if(a[0] != a[i]){
				resp++;
			}
		}			
	}	
	
	cout<<resp<<endl;
	
	
   	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string a;
      |         ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>> a;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:8:15: error: 'a' was not declared in this scope
    8 |         cin>> a;
      |               ^
a.cc:22:9: error: 'cout' was not declared in this scope
   22 |         cout<<resp<<endl;
      |         ^~~~
a.cc:22:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:21: error: 'endl' was not declared in this scope
   22 |         cout<<resp<<endl;
      |                     ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    int sou=0;
    for(int i=0;i<s.size();i++){
        if((s[i]+i)%2!=0)sou++;//頭白とする
    }
    cout << min(sou,s.size()-sou) << endl;
}

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

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<limits.h>
#include<float.h>

#define NUM 100001

int main(){
	char c[NUM];
	int bw = 0, wb = 0;
	scanf("%s\n", c);
	for(int i=0; c[i]; i++){
		if(i%2){
			if(c[i]=='0') wb++;
			else bw++
		} else {
			if(c[i]=='0') bw++;
			else wb++
		}
	}
	if(bw < wb)
		printf("%d\n", bw);
	else
		printf("%d\n", wb);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: expected ';' before '}' token
   16 |                         else bw++
      |                                  ^
      |                                  ;
   17 |                 } else {
      |                 ~                 
a.cc:19:34: error: expected ';' before '}' token
   19 |                         else wb++
      |                                  ^
      |                                  ;
   20 |                 }
      |                 ~
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
 
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    string s;
    cin >> s;
    ll count=0,ans;
    for (ll i=0;i<s.size();i++){
        if (i%2==0){
            if(s[i]==0)count++;
        }else{
            if(s[i]==1)count++;
        }
    }
    ans=count;
    count=0
    for (ll i=0;i<s.size();i++){
        if (i%2==1){
            if(s[i]==0)count++;
        }else{
            if(s[i]==1)count++;
        }
    }
    ans=min(ans,count);
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:82:12: error: expected ';' before 'for'
   82 |     count=0
      |            ^
      |            ;
   83 |     for (ll i=0;i<s.size();i++){
      |     ~~~     
a.cc:83:17: error: 'i' was not declared in this scope
   83 |     for (ll i=0;i<s.size();i++){
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll a, b;
  a = 0;
  string s;
  in(s);
  rep(i, s.size()){
    if(i % 2 == 0){
      if(s[i] == '0')
        a++;
    }
    else{
      if(s[i] == '1')
        a++;
    }
  }
  a = min(a, s.size() - a);
  out(a);
  memi;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;cin>>S;int A=0;
  for(int i=0;i<S.size();i++){
    if((i%2==0&&S.at(i)=='0')||(i%2==1&&S.at(i)=='1'))A++;
  }
  cout<<min(A,S.size()-A)<<endl;
}

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

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

int main() {
  string S;
  cin >> S;
  int A = 0;
  for (int i = 0; i < S.size(); i += 2) {
    if (S.at(i) == '0') A++;
  }
  for (int i = 1; i < S.size(); i += 2) {
    if (S.at(i) == '1') A++;
  }
  cout << min(A, S.size() - A) << endl;
}


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

// [[ABC134C] Exception Handling] https://www.luogu.com.cn/problem/AT4843
#include <algorithm>
#include <iostream>
using namespace std;
string s;
int main() {
  cin >> s;

  const int slen = s.length();
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < n; i++)
  {
    if (s[i] != i%2)
    {
      ans1++;
    } else {
      ans2++;
    }
  }

  cout << min(ans1, ans2) << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'n' was not declared in this scope
   11 |   for (int i = 0; i < n; i++)
      |                       ^