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

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

int main() {
  string a;
  cin >> a;
  int counter1 = 0;
  int previous = a[0];
  for (int i = 1; i < a.length(); i++) {
    if (previous == a[i]) {
      counter1++;
    }
  if (previous == '1') previous = '0';
    else previous = '1';
  }
  if (a[0]== '1') previous = '0';
  else a[0] = '1';
  int counter2 = 0;
  previous = a[0];
  for (int i = 1; i < a.length(); i++) {
    if (previous == a[i]) {
      counter2++;
    }
  if (previous == '1') previous = '0';
    else previous = '1';
  }
  cout << min(counter1, counter2);
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    2 | #inlcude <algorithm>
      |  ^~~~~~~
      |  include
Language: C++

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

int main() {
  string a;
  cin >> a;
  int counter1 = 0;
  int previous = a[0];
  for (int i = 1; i < a.length(); i++) {
    if (previous == a[i]) {
      counter1++;
    }
  if (previous == '1') previous = '0';
    else previous = '1';
  }
  if (a[0]== '1') previous = '0';
  else a[0] = '1';
  int counter2 = 0;
  int previous = a[0];
  for (int i = 1; i < a.length(); i++) {
    if (previous == a[i]) {
      counter2++;
    }
  if (previous == '1') previous = '0';
    else previous = '1';
  }
  cout << min(counter1, counter2);
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    2 | #inlcude <algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:20:7: error: redeclaration of 'int previous'
   20 |   int previous = a[0];
      |       ^~~~~~~~
a.cc:9:7: note: 'int previous' previously declared here
    9 |   int previous = a[0];
      |       ^~~~~~~~
Language: C++

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

int main() {
  string s;
  cin >> s;
  int counter1 = 0;
  int previous = a[0];
  for (int i = 1; i < s.length(); i++) {
    if (previous == a[i]) {
      counter1++;
    }
  if (previous == '1') previous = '0';
    else previous = '1';
  }
  if (a[0]== '1') previous = '0';
  else a[0] = '1';
  int counter2 = 0;
  int previous = a[0];
  for (int i = 1; i < s.length(); i++) {
    if (previous == a[i]) {
      counter2++;
    }
  if (previous == '1') previous = '0';
    else previous = '1';
  }
  cout << min(counter1, counter2);
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    2 | #inlcude <algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:9:18: error: 'a' was not declared in this scope
    9 |   int previous = a[0];
      |                  ^
a.cc:20:7: error: redeclaration of 'int previous'
   20 |   int previous = a[0];
      |       ^~~~~~~~
a.cc:9:7: note: 'int previous' previously declared here
    9 |   int previous = a[0];
      |       ^~~~~~~~
Language: C++

#include <iostream>
typedef long long ll;
using namespace std;
int main()
{
	ll N;
	ll num;
	ll time=0;
	ll i,j;
	//pair<ll,ll> H[50];
	ll H[50];
	cin>>N;
	for(ll i=0;i<N;i++){
		cin>>H[i];//=make_pair(num,i);
	}
	num=0;
	for(i=0;i<N;i++){
		for(j=0;j<i;j++){
			if(H[i]>=H[j]) num++;
		}
		if(num==i) time++;
		num=0;
	}
	cout<<time<<endl;
}
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
	ll N;
	ll num;
	ll time=0;
	ll i,j;
	//pair<ll,ll> H[50];
	ll H[50];
	cin>>N;
	for(ll i=0;i<N;i++){
		cin>>H[i];//=make_pair(num,i);
	}
	num=0;
	for(i=0;i<N;i++){
		for(j=0;j<i;j++){
			if(H[i]>=H[j]) num++;
		}
		if(num==i) time++;
		num=0;
	}
	cout<<time<<endl;
}

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

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
	ll N;
	ll num;
	ll time=0;
	ll i,j;
	//pair<ll,ll> H[50];
	ll H[50];
	cin>>N;
	for(ll i=0;i<N;i++){
		cin>>H[i];//=make_pair(num,i);
	}
	num=0;
	for(i=0;i<N;i++){
		for(j=0;j<i;j++){
			if(H[i]>=H[j]) num++;
		}
		if(num==i) time++;
		num=0;
	}
	cout<<time<<endl;
}
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
	ll N;
	ll num;
	ll time=0;
	ll i,j;
	//pair<ll,ll> H[50];
	ll H[50];
	cin>>N;
	for(ll i=0;i<N;i++){
		cin>>H[i];//=make_pair(num,i);
	}
	num=0;
	for(i=0;i<N;i++){
		for(j=0;j<i;j++){
			if(H[i]>=H[j]) num++;
		}
		if(num==i) time++;
		num=0;
	}
	cout<<time<<endl;
}

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

#include <iostream>
typedef long long ll;
using namespace std;
int main()
{
	ll N;
	ll num;
	ll time=0;
	ll i,j;
	//pair<ll,ll> H[50];
	ll H[50];
	cin>>N;
	for(ll i=0;i<N;i++){
		cin>>H[i];//=make_pair(num,i);
	}
	num=0;
	for(i=0;i<N;i++){
		for(j=0;j<i;j++){
			if(H[i]>=H[j]) num++;
		}
		if(num==i) time++;
		num=0;
	}
	cout<<time<<endl;
}
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
	ll N;
	ll num;
	ll time=0;
	ll i,j;
	//pair<ll,ll> H[50];
	ll H[50];
	cin>>N;
	for(ll i=0;i<N;i++){
		cin>>H[i];//=make_pair(num,i);
	}
	num=0;
	for(i=0;i<N;i++){
		for(j=0;j<i;j++){
			if(H[i]>=H[j]) num++;
		}
		if(num==i) time++;
		num=0;
	}
	cout<<time<<endl;
}
提出情報

Compiler output:
a.cc:29:5: error: redefinition of 'int main()'
   29 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
a.cc:51:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   51 | 提出情報
      | ^~~~~~~~
Language: C++

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

int main(){
  string S;
  cin >> S;
  int ans = S.size();

  for(int i =0; i<2; i++){
    int cnt=0;
    for(int j=0; j<S.size(); j++){
      if(j%2==0 && s[j]!=(char)(i+'0')) cnt++;
      if(j%2==1 && s[j]==(char)(i+'0')) cnt++;
    }
    int ans =min(ans, cnt);
  }

  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 's' was not declared in this scope
   12 |       if(j%2==0 && s[j]!=(char)(i+'0')) cnt++;
      |                    ^
a.cc:13:20: error: 's' was not declared in this scope
   13 |       if(j%2==1 && s[j]==(char)(i+'0')) cnt++;
      |                    ^
Language: C++

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

int main(){
  string S;
  cin >> S;
  int ans = S.size();

  for(int i =0; i<2; i++){
    int cnt=0;
    for(int j=0; j<S.size(); j++){
      if(j%2==0 && s[j]!=(char)(i+'0')) cnt++;
      if(j%2==1 && s[j]==(char)(i+'0')) cnt++;
    }
  }

  cout << min(ans, cnt) << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 's' was not declared in this scope
   12 |       if(j%2==0 && s[j]!=(char)(i+'0')) cnt++;
      |                    ^
a.cc:13:20: error: 's' was not declared in this scope
   13 |       if(j%2==1 && s[j]==(char)(i+'0')) cnt++;
      |                    ^
a.cc:17:20: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |   cout << min(ans, cnt) << endl;
      |                    ^~~
      |                    int
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int a=0,b=0;
  for(int i=0;i<s.size();i++){
    if(s[i]=='0'){
      if(i%2==0){
        a++;
      }else{
         b++;
       }
    }elae{
       if(i%2==0){
         b++;
       }else{
         a++;
        }
     }
  }
  cout<<min(a,b)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:6: error: 'elae' was not declared in this scope
   14 |     }elae{
      |      ^~~~
Language: C++

#include <iodtream>
#include <string>
#include <algorithm>

using namespace std;

int main(){
 	string s;
  	cin >> s;
  	int i,size = s.length(),n = 0,ans[2];

   	while(n<size-1){
       	if(s[n]=='0')ans[0]++;
       	if(s[n+1]=='1') ans[0]++;
   		n += 2;
    }
   	if(size%2==1 && s[size-1]=='0') ans[0]++;
  
  	while(n<size-1){
       	if(s[n]=='1')ans[1]++;
       	if(s[n+1]=='0') ans[1]++;
   		n += 2;
    }
   	if(size%2==1 && s[size-1]=='1') ans[1]++;
  
  	cout << min(ans[0],ans[1]) << endl;
}
  

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int countA=0;
  int countB=0;
  for(int i=0;i<S.size();i++){
    if(S.at(2*i)=='1'){
      countB++;
    }
    else{
      countA++;
    }
    if(S.at(2*i+1)=='0'){
      countB++;
    }
    else{
      countA++
    }
  }
  cout << min(countA,countB);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: expected ';' before '}' token
   20 |       countA++
      |               ^
      |               ;
   21 |     }
      |     ~
Language: C

#include <stdio.h>
#include <string.h>
int main()
{
    char str[100000];
    int i=0,count=0,N=0,revcount=0,t=0;
    scanf("%s",&str);
    N=strlen(str);
    for(i=0;i<N-1;i++)
    {
        if(str[i]=='0' && str[i+1]!='1')
        {
            str[i+1]='1';
            count++;
        }
        if(str[i]=='1' && str[i+1]!='0')
        {
            str[i+1]='0';
            count++;
        }
    }
    strrev(str);
     for(i=0;i<N-1;i++)
    {
        if(str[i]=='0' && str[i+1]!='0')
        {
            str[i+1]='1';
            revcount++;
        }
        if(str[i]=='1' && str[i+1]!='1')
        {
            str[i+1]='0';
            revcount++;
        }
    }
    if(revcount<count)
    {
        t=revcount;
    }
    else
    {
        t=count;
    }
    printf("%d\n",t);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:22:5: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
   22 |     strrev(str);
      |     ^~~~~~
      |     strsep
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int s,k;
 cin >> s ;
 if (s == 10101){
  k=0;
  cout << k;
 }
 else if (s==101 || s==10001 || s==10100 || s==10111 || s==11101){
   k=1;
   cout<<k;
  }
   else if (s==1||s==10||s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
   k=2;
   cout<<k;
  else {
    k=3;
    cout<<k;
  }
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:138: error: lvalue required as left operand of assignment
   15 |    else if (s==1||s==10||s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:18:3: error: expected '}' before 'else'
   18 |   else {
      |   ^~~~
a.cc:15:149: note: to match this '{'
   15 |    else if (s==1||s==10||s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
      |                                                                                                                                                     ^
a.cc: At global scope:
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int s,k;
 cin >> s ;
 if (s == 10101){
  k=0;
  cout << k;
 }
 else if (s==101 || s==10001 || s==10100 || s==10111 || s==11101){
   k=1;
   cout<<k;
  }
   else if (s==1||s==10||)s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
   k=2;
   cout<<k;
  else {
    k=3;
    cout<<k;
  }
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: expected primary-expression before ')' token
   15 |    else if (s==1||s==10||)s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
      |                          ^
a.cc:15:139: error: lvalue required as left operand of assignment
   15 |    else if (s==1||s==10||)s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
      |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int s,k;
 cin >> s ;
 if (s == 10101){
  k=0;
  cout << k;
 }
 else if (s== || s==101 || s==10001 || s==10100 || s==10111 || s==11101){
   k=1;
   cout<<k;
  }
   else if (s==1||s==10||)s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
   k=2;
   cout<<k;
  else {
    k=3;
    cout<<k;
  }
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected primary-expression before '||' token
   11 |  else if (s== || s==101 || s==10001 || s==10100 || s==10111 || s==11101){
      |               ^~
a.cc:15:26: error: expected primary-expression before ')' token
   15 |    else if (s==1||s==10||)s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
      |                          ^
a.cc:15:139: error: lvalue required as left operand of assignment
   15 |    else if (s==1||s==10||)s==100|| s==111||s==1000||s==1011|| s==1101||s==1110||s==10000||s==10011||s==10110||s==11001||s==11010||s==11100||s=011111){
      |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C

#include <stdio.h>
#include <string.h>
int main()
{
    char str[100000];
    int i=0,count=0,N=0,revcount=0,t=0;
    scanf("%s",str);
    N=strlen(str);
    for(i=0;i<N-1;i++)
    {
        if(str[i]=='0' && str[i+1]!='1')
        {
            str[i+1]='1';
            count++;
        }
        if(str[i]=='1' && str[i+1]!='0')
        {
            str[i+1]='0';
            count++;
        }
    }
    str=strrev(str);
     for(i=0;i<N-1;i++)
    {
        if(str[i]=='0' && str[i+1]!='0')
        {
            str[i+1]='1';
            revcount++;
        }
        if(str[i]=='1' && str[i+1]!='1')
        {
            str[i+1]='0';
            revcount++;
        }
    }
    if(revcount<count)
    {
        t=revcount;
    }
    else
    {
        t=count;
    }
    printf("%d\n",t);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:22:9: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
   22 |     str=strrev(str);
      |         ^~~~~~
      |         strsep
main.c:22:8: error: assignment to expression with array type
   22 |     str=strrev(str);
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int countA=0;
  int countB=0;
  for(int i=0;i<S.size();i++){
    if(S.at(2*i)=='1'){
      countB++;
    }
    else{
      countA++;
    }
    if(S.at(2*i+1)=='0'){
      countB++;
    }
    else{
      countA++
    }
  }
  cout << min(countA,countB);
}
       

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: expected ';' before '}' token
   20 |       countA++
      |               ^
      |               ;
   21 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define str string
#define rep(x,y) for(int i=x;i<y;i++)
#define REP(x,y) for(int j=x;j<y;j++)
#define all(x) x.begin(),x.end()
int main(){
  int A,C=0,count=0,count2=0,D;
  str S;
  cin>>S;
  if(S.size()%2==1){D=S.size()/2+1;
  do{
    if(S.at(C)!=0)count+=1;
    else if(S.at(C)!=1)count2+=1;
    if(S.at(C+1)!=1)count+=1;
    if(S.at(C+1)!=0)count2+=1;
    C+=2;
  }while(C<D);}
  else D=S.size()/2;
  if(S.at(C)!=0)count+=1;
  else if(S.at(C)!=1)count2+=1;
  if(S.at(C+1)!=1)count+=1;
  if(S.at(C+1)!=0)count2+=1;
  C+=2;
}while(C<D);}
  cout<<min(count,count2)<<endl;
}


Compiler output:
a.cc:26:2: error: expected unqualified-id before 'while'
   26 | }while(C<D);}
      |  ^~~~~
a.cc:26:13: error: expected declaration before '}' token
   26 | }while(C<D);}
      |             ^
a.cc:27:3: error: 'cout' does not name a type
   27 |   cout<<min(count,count2)<<endl;
      |   ^~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
int main(){
	int n,k;
	string s;
	cin >> n>>k>>s;

	vector<int> V;

	int cnt = 1;

	rep(i,n-1) {
		if (s[i+1]==s[i]) {
			cnt++;
		} else {
			V.push_back(cnt);
			cnt = 1;
		}
	}
	V.push_back(cnt);
	// rep(i, (int)V.size()) {
	// 	cout << V[i] << " ";
	// }


	int ma = 0;
	if (s[0]=='1') {
		for (int beg=0; beg<(int)V.size(); beg+=2) {
			int end = min((int)V.size()-1, beg+2*k);
			int tem = 0;
			for (int i = beg; i<=end; i++) {
				tem+=V[i];
			} 
			ma = max(tem, ma);
		}
	} else {
		int end = min((int)V.size()-1, 2*k-1)
		for (int i = 0; i<=end;i++) {
			ma+=V[i];
		}

		for (int beg=1; beg<(int)V.size(); beg+=2) {
			int end = min((int)V.size()-1, beg+2*k);
			int tem = 0;
			for (int i = beg; i<=end; i++) {
				tem+=V[i];
			} 
			ma = max(tem, ma);
		}
	}

	cout << ma << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:41:17: error: expected ',' or ';' before 'for'
   41 |                 for (int i = 0; i<=end;i++) {
      |                 ^~~
a.cc:41:33: error: 'i' was not declared in this scope
   41 |                 for (int i = 0; i<=end;i++) {
      |                                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;

typedef pair<int, int> ii;

typedef vector<bool> vb;

int main( int argc, char *argv[] ) {
	string T;

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> T;
	if ( T.size() == 1 ){
		std::cout << 0 << std::endl;
	}else if ( T.size() == 2 ){
		if ( T[0] != T[1] )
			std::cout << 1 << std::endl;
		else
			std::cout << 0 << std::endl;
	}else{
		int n = 0;
		if ( T[0] != T[1] && T[1] == T[2] )
			n = 2;
		else if ( T[0] == T[1] && T[1] = T[2] )
			n = 1;
		else if ( T[0] == T[1] )
			n = 1;
		for ( int i = 2 ; i < T.size() - 1 ; i++ ){
			if ( T[i] == T[i+1] )
				n++;
		}
		std::cout << n << std::endl;
	}
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:30:40: error: lvalue required as left operand of assignment
   30 |                 else if ( T[0] == T[1] && T[1] = T[2] )
Language: C++

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

int main() {
	int ans = 0;
	string str;
	cin >> str;
	char run = '2';
	for (int i = 0; i < (int)str.size(); i++) {
		char ch = str[i];
		if (ch == run) {
			ans++;
			if (ch == '0') {
				run = '1';
			}
			else {
				run = '0';
			}
		}
		else {
			if (ch == '0') {
				run = '0';
			}
			else {
				run = '1';
			}
		}
	}
	cout << ans << endl;
}

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

#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
# define ll long long
int main (){
    string s;
    cin >> s;
    int c1, c2;
    for (int i = 0; i < s.size(); i++){
        if (i % 2 == 0){
            if (s[i] == 0){
                c1++;
            } else {
                c2++;
            }
        } else {
            if (s[i] == 1){
                c2++;
            } else {
                c1++;
            }
        
        int ans;
        if (c1 <= c2) ans = c1;
        else ans = c2;
        cout << ans << endl;
        return 0;
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:13:39: note: to match this '{'
   13 |     for (int i = 0; i < s.size(); i++){
      |                                       ^
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:9:12: note: to match this '{'
    9 | int main (){
      |            ^
Language: C

#include <stdio.h>
#include <string.h>
int main()
{
    char str[100000];
    int i=0,count=0,N=0,revcount=0,t=0;
    scanf("%s",str);
    N=strlen(str);
    for(i=0;i<N-1;i++)
    {
        if(str[i]=='0' && str[i+1]!='1')
        {
            str[i+1]='1';
            count++;
        }
        if(str[i]=='1' && str[i+1]!='0')
        {
            str[i+1]='0';
            count++;
        }
    }
    strrev(str);
     for(i=0;i<N-1;i++)
    {
        if(str[i]=='0' && str[i+1]!='0')
        {
            str[i+1]='1';
            revcount++;
        }
        if(str[i]=='1' && str[i+1]!='1')
        {
            str[i+1]='0';
            revcount++;
        }
    }
    if(revcount<count)
    {
        t=revcount;
    }
    else
    {
        t=count;
    }
    printf("%d\n",t);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:22:5: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
   22 |     strrev(str);
      |     ^~~~~~
      |     strsep
Language: C++

#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
# define ll long long
int main (){
    string s;
    cin >> s;
    int c1, c2;
    for (int i = 0; i < s.size(); i++){
        if (i % 2 == 0){
            if (s[i] == 0){
                c1++;
            } else {
                c2++;
            }
        } else {
            if (s[i] == 1){
                c2++;
            } else {
                c1++;
            }
        }
        int ans;
        if (c1 <= c2) ans = c1;
        else ans = c2;
        cout << ans << endl;
        return 0;
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:9:12: note: to match this '{'
    9 | int main (){
      |            ^
Language: C

#include <stdio.h>
#include <string.h>
int main()
{
    char str[100000];
    int i=0,count=0,N=0,revcount=0,t=0;
    scanf("%s",&str);
    N=strlen(str);
    for(i=0;i<N-1;i++)
    {
        if(str[i]=='0' && str[i+1]!='1')
        {
            str[i+1]='1';
            count++;
        }
        if(str[i]=='1' && str[i+1]!='0')
        {
            str[i+1]='0';
            count++;
        }
    }
    strrev(str);
     for(i=0;i<N-1;i++)
    {
        if(str[i]=='0' && str[i+1]!='0')
        {
            str[i+1]='1';
            revcount++;
        }
        if(str[i]=='1' && str[i+1]!='1')
        {
            str[i+1]='0';
            revcount++;
        }
    }
    if(revcount<count)
    {
        t=revcount;
    }
    else
    {
        t=count;
    }
    printf("%d\n",t);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:5: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
   22 |     strrev(str);
      |     ^~~~~~
      |     strsep
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
#define DEBUGGING

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T, typename U> using P = pair<T, U>;
using ll = int64_t;
using PLL = P<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename Head, typename... Tail> const Head& var_min(const Head &head, const Tail&... tail) { return min(head, var_min(tail...)); }
template <typename Head, typename... Tail> const Head& var_max(const Head &head, const Tail&... tail) { return max(head, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }

namespace __init {

struct InitIO {
    InitIO() {
        cin.tie(0);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifdef DEBUGGING
#include "../debug.cpp"
#else
#define DEBUG(...) 0
#endif

int main() {
    string S;
    cin >> S;
    ll ans = S.size() + 1;
    for(ll init = 0; init <= 1; init++) {
        ll tmp = 0;
        for(ll i = 0; i < S.size(); i++) {
            char c = '0' + (i + init) % 2;
            tmp += (c != S[i]);
        }
        chmin(ans, tmp);
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc:34:10: fatal error: ../debug.cpp: No such file or directory
   34 | #include "../debug.cpp"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bitset>
#include <cstdio>

using namespace std;

int main()
{
  string s;
  cin >> s;
  bitset<s.length()> b(s);
  int t=b[0];
  int ans=0;
  for (int i=1; i<b.size(); ++i) {
    if (b[i] == t) ++ans;
    t = ~t;
  }
  printf("%d", ans);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> s;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <cstdio>
  +++ |+#include <iostream>
    3 | 
a.cc:10:18: error: call to non-'constexpr' function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
   10 |   bitset<s.length()> b(s);
      |          ~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1083:7: note: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' declared here
 1083 |       length() const _GLIBCXX_NOEXCEPT
      |       ^~~~~~
a.cc:10:18: error: call to non-'constexpr' function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
   10 |   bitset<s.length()> b(s);
      |          ~~~~~~~~^~
/usr/include/c++/14/bits/basic_string.h:1083:7: note: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' declared here
 1083 |       length() const _GLIBCXX_NOEXCEPT
      |       ^~~~~~
a.cc:10:18: note: in template argument for type 'long unsigned int'
   10 |   bitset<s.length()> b(s);
      |          ~~~~~~~~^~
a.cc:10:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
   10 |   bitset<s.length()> b(s);
      |                        ^
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
a.cc:11:10: error: invalid types 'int[int]' for array subscript
   11 |   int t=b[0];
      |          ^
a.cc:13:21: error: request for member 'size' in 'b', which is of non-class type 'int'
   13 |   for (int i=1; i<b.size(); ++i) {
      |                     ^~~~
a.cc:14:10: error: invalid types 'int[int]' for array subscript
   14 |     if (b[i] == t) ++ans;
      |          ^
Language: C++

#include <bitset>
#include <cstdio>

using namespace std;

int main()
{
  string s;
  cin >> s;
  bitset<s.len> b(s);
  int t=b[0];
  int ans=0;
  for (int i=1; i<s.length(); ++i) {
    if (b[i] == t) ++ans;
    t = ~t;
  }
  printf("%d", ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> s;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <cstdio>
  +++ |+#include <iostream>
    3 | 
a.cc:10:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'len'
   10 |   bitset<s.len> b(s);
      |            ^~~
a.cc:10:15: error: template argument 1 is invalid
   10 |   bitset<s.len> b(s);
      |               ^
a.cc:10:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
   10 |   bitset<s.len> b(s);
      |                   ^
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
a.cc:11:10: error: invalid types 'int[int]' for array subscript
   11 |   int t=b[0];
      |          ^
a.cc:14:10: error: invalid types 'int[int]' for array subscript
   14 |     if (b[i] == t) ++ans;
      |          ^
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;


int main () {
	string s;

	int  i_cnt = 0, n_cnt = 0, cnt=0;

	cin >> s;

	if (s.size() % 2 == ) cnt--;

	for (int i = 1; i < s.size(); i+=2) {
		if (s[i] + s[i + 1] == 96) {
			cnt++;
		}
		else if (s[i] + s[i + 1] == 98) {
			cnt++;
		}
		else {
			if (s[i] == '0') {
				i_cnt++;
			}
			else {
				n_cnt++;
			}
		}
	}
	if (i_cnt > n_cnt) {
		cnt += 2*n_cnt;
	}
	else {
		cnt += 2*i_cnt;
	}
	cout << cnt;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: expected primary-expression before ')' token
   15 |         if (s.size() % 2 == ) cnt--;
      |                             ^
Language: C

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

int main(void){
  int i, len, even0=0, odd0=0, even1=0, odd1=0, ans;
  char s[100000];
  scanf("%s", s);
  len = strlen(s);
  for(i=0;i<len;i+=2){
    if(s[i]=='0') even0++;
  }
  for(i=1;i<len;i+=2){
    if(s[i]=='0') odd0++;
  }
  even1=(len+1)/2 - even0;
  odd1 = len/2 - odd0;
  ans = (even1+odd0) > (even0+odd1)?(even0+odd1):(even1+odd0);
  printf("%d\n", ans);
  return0;
}
  
  

Compiler output:
main.c: In function 'main':
main.c:19:3: error: 'return0' undeclared (first use in this function)
   19 |   return0;
      |   ^~~~~~~
main.c:19:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main(){
  char s[100000];
  int c[4];
  c[0] = 0;
  c[1] = 0;
  c[2] = 0;
  c[3] = 0;
  int  ans = 0;
  cin >> s;
  int  len = strlen(s);

    for(int i=0;i<len;i+=2){
      if(s[i]=='0' && s[i+1]=='0'){
        c[0]=c[0]+1;
      }else if(s[i]=='0' && s[i+1]=='1'){
        c[1]=c[1]+1;
      }else if(s[i] == '1' &&s[i+1] == '0'){
        c[2]=c[2]+1;
      }else if(s[i]=='1' && s[i+1]=='1'){
        c[3]=c[3]+1;
      }
    }
    if(len%2==0){
      if(c[1]>=c[2]){
        cout << c[0]+c[3]+2*c[2] << endl;
      }else if(c[2]>c[1]){
        cout << c[1]*2 + c[0] + c[3] << endl;
      }
    }else if(len%2==1){
      if(c[1]>=c[2] && s[len-1]=='0'){
        cout << c[0]+c[3]+2*c[2]+1 << endl;
      }else if(c[1]>=c[2] && s[len-1]=='1'){
        cout <<	c[0]+c[3]+2*c[2] << endl;
      }else if(c[2] > c[1] && s[len-1] == '0'){
        cout << c[1]*2 + c[0] + c[3] +1	<< endl;
      }else{
        cout <<	c[1]*2 + c[0] +	c[3] << endl;
      } 

}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

  string s,t;
  cin>>s;

int main(){
  int ans=0;
  for(int i=0;i<s.size();i++){
    t[i]=s[i]-'0';
  }
  if(s[0]=='1'){
    for(int i=0;i<s.size();i++){
      if(i%2==0){
        if(t[i]!=1){
          ans++;
        }
      }
      if(i%2==1){
        if(t[i]!=0){
          ans++;
        }
      }
    }
  }
  else{
    for(int i=0;i<s.size();i++){
      if(i%2==1){
        if(t[i]!=1){
          ans++;
        }
      }
      if(i%2==0){
        if(t[i]!=0){
          ans++;
        }
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc:6:3: error: 'cin' does not name a type
    6 |   cin>>s;
      |   ^~~
Language: C++

int main () {
	string s;

	int  i_cnt = 0, n_cnt = 0, cnt=0;

	cin >> s;


	for (int i = 1; i < s.size(); i+=2) {
		if (s[i] + s[i + 1] == 96) {
			cnt++;
		}
		else if (s[i] + s[i + 1] == 98) {
			cnt++;
		}
		else {
			if (s[i] == '0') {
				i_cnt++;
			}
			else {
				n_cnt++;
			}
		}
	}
	if (i_cnt > n_cnt) {
		cnt += 2*n_cnt;
	}
	else {
		cnt += 2*i_cnt;
	}
	cout << cnt;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'string' was not declared in this scope
    2 |         string s;
      |         ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> s;
      |         ^~~
a.cc:6:16: error: 's' was not declared in this scope
    6 |         cin >> s;
      |                ^
a.cc:31:9: error: 'cout' was not declared in this scope
   31 |         cout << cnt;
      |         ^~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string s;
  cin >> s;
  int count1=0, count2=0;
  for(int i=0; i<s.size()/2, i++){
    if(s[0] == s[i*2]){
      count1++;
    }
    else if(s[1] == s[i*2+1]){
      count2++;
    }
  }
  if(count1 < count2){
    int a = count2-count1;
    cout << a;
  }
  else{
    int b = count1-count2;
    cout << b;

Compiler output:
a.cc: In function 'int main()':
a.cc:8:33: error: expected ';' before ')' token
    8 |   for(int i=0; i<s.size()/2, i++){
      |                                 ^
      |                                 ;
a.cc:22:15: error: expected '}' at end of input
   22 |     cout << b;
      |               ^
a.cc:20:7: note: to match this '{'
   20 |   else{
      |       ^
a.cc:22:15: error: expected '}' at end of input
   22 |     cout << b;
      |               ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

int main(){
  int S;
  cin>>S;
  int n=S.size(),c=0,d=0;
  vector<string>v(n);
  vector<string>a(n);
  vector<string>b(n);
  for (int i=0;i<n;i++){
    v.at(i)=S.at(i);
    if (i%2==0){
      a.at(i)="0";
      b.at(i)="1";
    }
    else {
      b.at(i)="0";
      a.at(i)="1";
    }
  }
  for (int i=0;i<n;i++){
    if (v.at(i)!=a.at(i)){
      c++;
    }
    if (v.at(i)!=b.at(i)){
      d++;
    }
  }
  if (c>d){
    cout<<d<<endl;
  }
  else {
    cout<<c<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: request for member 'size' in 'S', which is of non-class type 'int'
    7 |   int n=S.size(),c=0,d=0;
      |           ^~~~
a.cc:12:15: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |     v.at(i)=S.at(i);
      |               ^~
a.cc:24:7: error: 'c' was not declared in this scope
   24 |       c++;
      |       ^
a.cc:27:7: error: 'd' was not declared in this scope
   27 |       d++;
      |       ^
a.cc:30:7: error: 'c' was not declared in this scope
   30 |   if (c>d){
      |       ^
a.cc:30:9: error: 'd' was not declared in this scope
   30 |   if (c>d){
      |         ^
Language: C

#include<stdio.h>

int main(){
  char S[100000],i,sum=0;
  scanf("%s" S);
  
  for( i = 1; S[i] != '\0'; i++ ) {
    if(S[i]==S[i-1]){
      if(S[i]=="1") S[i] = "0";
      else S[i] = "1";
      sum++;
    }
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:13: error: expected ')' before 'S'
    5 |   scanf("%s" S);
      |        ~    ^~
      |             )
main.c:9:14: warning: comparison between pointer and integer
    9 |       if(S[i]=="1") S[i] = "0";
      |              ^~
main.c:9:26: error: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    9 |       if(S[i]=="1") S[i] = "0";
      |                          ^
main.c:10:17: error: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   10 |       else S[i] = "1";
      |                 ^
Language: C

#include<stdio.h>

int main(){
  int x,i,j=0,k=0;
  scanf("%d", &x);

  int a[10e5];

  for(i=0;i<10e5;i++){
    a[i]=2;
  }

  for(i=0;i<x;i++){
    a[i]=x&1;
    x=x>>1;
  }

  for(i=0;i<x;i++){

    if((i%2==0&&a[i]==1)||(i%2==1&&a[i]==0)){
      j++;
    }
    if((i%2==1&&a[i]==1)||(i%2==0&&a[i]==0)){
      k++;
    }
  }

  k= k<j ? j:k;

  printf("%d",k);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:7: error: size of array 'a' has non-integer type
    7 |   int a[10e5];
      |       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  string str;
  string pattern1;
  string pattern2;
  
  int count1=0;
  int count2=0;
  
  cin >> str;
  
  for(int i=0;i<str.size();i++){
    pattern1.push_back(i%2);
    pattern1.push_back((i+1)%2);
  }
  
  for(int i=0;i<str.size();i++){
    if(str[i] != pattern1[i]){
      count1++;
    }
    if(str[i] != pattern2[i]){
      count2++;
    }
  }
  count << max(count1,count2) << endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: invalid operands of types '<unresolved overloaded function type>' and 'const int' to binary 'operator<<'
   28 |   count << max(count1,count2) << endl;
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main() {
  string s;
  cin >> s;
  int ans=0;
  for(int i=1;i<s.size();i++){
    if(s.at(i)==s.at(i-1)){
      ans++;
      if(s.at(i)=='0') s.at(i)='1';
      else s.at(i)='0'
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected ';' before '}' token
   12 |       else s.at(i)='0'
      |                       ^
      |                       ;
   13 |     }
      |     ~
Language: C++

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(int argc, char const *argv[]) {
  string s;
  cin>>s;
  string s1;
  int size=s.size();
  s1.push_back(s[0]);
  for(int i=1;i<size;i++){
    if(s1[i-1]=='0')  s1.push_back('1');
    if(s1[i-1]=='1')  s1.push_back('0');
  }

  // cout<<"順数列"<<s1<<endl;

  int count1=0;

  for(int i=0;i<size;i++){
    int tmp1=s[i]-'0';
    int tmp2=s1[i]-'0';

    // cout<<"tmp1="<<tmp1<<"tmp2="<<tmp2<<endl;

    count1+=abs(tmp1-tmp2);
  }

  int count2;
  string s2;
  if(s1[size-1]!=s[size-1]){
    s2+=s[size-1];
    for(int i=size-2;i>=0;i--){
      if(s2[i-1]=='0')  s2='1'+s1;
      if(s2[i-1]=='1')  s2='0'+s1;
    }

    // cout<<"逆数列"<<s1<<endl;
    count2=0;
    for(int i=0;i<size;i++){
      int tmp1=s[i]-'0';
      int tmp2=s2[i]-'0';
      count2+=abs(tmp1-tmp2);
    }
  }else{
    count2=count1;
  }


  if(count1<count2){
    cout<<count1<<endl;
  }else{
    cout<<count2<<endl;
  }

  return 0;
}
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(int argc, char const *argv[]) {
  string s;
  cin>>s;
  string s1;
  int size=s.size();
  s1.push_back(s[0]);
  for(int i=1;i<size;i++){
    if(s1[i-1]=='0')  s1.push_back('1');
    if(s1[i-1]=='1')  s1.push_back('0');
  }

  // cout<<"順数列"<<s1<<endl;

  int count1=0;

  for(int i=0;i<size;i++){
    int tmp1=s[i]-'0';
    int tmp2=s1[i]-'0';

    // cout<<"tmp1="<<tmp1<<"tmp2="<<tmp2<<endl;

    count1+=abs(tmp1-tmp2);
  }

  int count2;
  string s2;
  if(s1[size-1]!=s[size-1]){
    s2+=s[size-1];
    for(int i=size-2;i>=0;i--){
      if(s2[i-1]=='0')  s2='1'+s1;
      if(s2[i-1]=='1')  s2='0'+s1;
    }

    // cout<<"逆数列"<<s1<<endl;
    count2=0;
    for(int i=0;i<size;i++){
      int tmp1=s[i]-'0';
      int tmp2=s2[i]-'0';
      count2+=abs(tmp1-tmp2);
    }
  }else{
    count2=count1;
  }


  if(count1<count2){
    cout<<count1<<endl;
  }else{
    cout<<count2<<endl;
  }

  return 0;
}


Compiler output:
a.cc:62:5: error: redefinition of 'int main(int, const char**)'
   62 | int main(int argc, char const *argv[]) {
      |     ^~~~
a.cc:5:5: note: 'int main(int, const char**)' previously defined here
    5 | int main(int argc, char const *argv[]) {
      |     ^~~~
Language: C

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

int main(){
  string s;
  cin >> s;
  int a,b;
  size_t size = s.length();
  a=0;
  b=0;
  for (int j=0;j<size;j++){
    if(j%2==0){
      if(s[j]=='0'){
	a++;}}
    if(j%2==1){
      if(s[j]=='1'){
	a++;
      }
    }}
  for(int k=0;k<size;k++){
    if(k%2==0){
      if(s[k]=='1'){
	b++;}}
    if(k%2==1){
      if(s[k]=='0'){
	b++;}}}
  if (a>b){
    cout <<a<< endl;
  }
  if (b>=a){
    cout <<b<< endl;
  }
}


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

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

int main() {

    string S, t;

    cin >> S;

    int N = S.size();

    int i, count = 0;

    for(i=0;i<N-1;++i){ 
      
        if(S.at(i+1) == S.at(i)){

            if(S.at(i+1) == '0'){
                S.at(i+1) = '1';
            }else{
                S.at(i+1) = '0';
            }
            count++;
        }
    }
    cout << count << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:26:27: error: expected '}' at end of input
   26 |     cout << count << endl;
      |                           ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	char s[100000];
	cin >> s;

	int n = strlen(s);
	
	int preNum;
	preNum = s[0] - '0';

	int change = 0;
	for (int i = 1; i < n;i++) {
		int n = s[i] - '0';
		if (n == preNum) {
			change++;
			preNum = n == 0 ? 1 : 0;
		}
		else {
			preNum = n;
		}
	}

	cout << change;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'strlen' was not declared in this scope
    8 |         int n = strlen(s);
      |                 ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int main(){
  string input;
  cin>>input;
  int N = (int)(input.length());
  int *correct1 = new int[N];
  int *correct2 = new int[N];
  for(int i=0; i<N; i++){
   if(i%2==0){
     correct1[i]='0'; 
     correct2[i]='1';  
   }
    else{
      correct1[i]='1'; 
      correct2[i]='0';  
   }  
  }
  
  int correct1rate=0;
  int correct2rate=0;
  int result;
  
  for(int i=0; i<N; i++){
   if((input[i]).c_str()==correct1[i]) correct1rate+=1; 
   else correct2rate+=1  ;
  }
  if(correct1rate>=correct2rate) result=N-correct1rate;
  else result=N-correct2rate;
  cout<<result;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: request for member 'c_str' in 'input.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   25 |    if((input[i]).c_str()==correct1[i]) correct1rate+=1;
      |                  ^~~~~
Language: C++

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

int main(){
    string S;
    cin >> S;
    double s_0 = 0,s_1 = 0;
    for(int i = 0;i < S.size();i++){
    	if(i%2==0){
    		if(S.at(i)=='1'){
    			s_0 +=1;
    		}else{
    			s_1 +=1;
    		}
    	}else{
    		if(S.at(i)=='1'){
    			s_1 +=1;
    		}else{
    			s_0 +=1;
    		}
    	}
    cout << min(s_0,s_1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include <stdio.h>

int main(int argc, char const *argv[]) {
  char arr[100001];
  char com='0';
  int i,count1=0,count2=0,
  scanf("%s", arr);

  for (i = 0; arr[i] != '\0'; i++) {
    if (com != arr[i]) {
      count1++;
    }
    if (com == '0') {
      com = '1';
    } else {
      com = '0';
    }
  }

  com = '1';

  for (i = 0; arr[i] != '\0'; i++) {
    if (com != arr[i]) {
      count2++;
    }
    if (com == '0') {
      com = '1';
    } else {
      com = '0';
    }
  }

  if (count1 > count2) {
    printf("%d\n",count1);
  } else {
    printf("%d\n",count2);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:9: error: expected declaration specifiers or '...' before string constant
    7 |   scanf("%s", arr);
      |         ^~~~
main.c:7:15: error: expected declaration specifiers or '...' before 'arr'
    7 |   scanf("%s", arr);
      |               ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	string S;
	cin >> S;
	int N = S.size();
	string S0 = '0', S1 = '1';
	for(int i = 1; i < N; i++){
		S0 += (i%2 ? '1' : '0');
		S1 += (i%2 ? '0' : '1');
	}
	int sum0 = 0, sum1 = 0;
	for(int i = 0; i < N; i++){
		if(S[i] != S0[i])
			sum0++;
		if(S[i] != S1[i])
			sum1++;
	}

	cout << (sum0>sum1 ? sum1 : sum0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    7 |         string S0 = '0', S1 = '1';
      |                     ^~~
a.cc:7:31: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    7 |         string S0 = '0', S1 = '1';
      |                               ^~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  string input_st;
  cin>>input_st;
  
  int *correct1 = new int[N];
  int *correct2 = new int[N];
  for(int i=0; i<N; i++){
   if(i%2==0){
     correct1[i]='0'; 
     correct2[i]='1';  
   }
    else{
      correct1[i]='1'; 
      correct2[i]='0';  
   }  
  }
  
  int correct1rate=0;
  int correct2rate=0;
  int result;
  
  for(int i=0; i<N; i++){
   if(input[i]!='0' && input[i]!='1'){
     result=0;
     return 0;
   }
   else if(input[i]==correct1[i]) correct1rate+=1; 
   else correct2rate+=1  ;
  }
  if(correct1rate>=correct2rate) result=N-correct1rate;
  else result=N-correct2rate;
  cout<<result;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:7: error: 'input' was not declared in this scope; did you mean 'int'?
   27 |    if(input[i]!='0' && input[i]!='1'){
      |       ^~~~~
      |       int
Language: C++

#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
	char S[100000];
	int i,left;
	gets(S);
	for(left=0,i=1;S[i]!='\0';i++)
	{
		if(S[i-1]==S[i])
		{
			left++;
			if(S[i]=='1')
				S[i]='0';
			else 
				S[i]='1';
		}
	}
	printf("%d\n",left);
	return 0;
}


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

import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main4 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> input = Arrays.stream(sc.nextLine().split("")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());

        int start0 = 0;
        int start0TargetNum = 0;
        int start1 = 0;
        int start1TargetNum = 1;

        for (int tar : input) {
            if (tar != start0TargetNum) start0++;
            if (tar != start1TargetNum) start1++;

            start0TargetNum = change(start0TargetNum);
            start1TargetNum = change(start1TargetNum);
        }

        if (start0 < start1) {
            System.out.println(start0);
        } else {
            System.out.println(start1);
        }
    }

    public static int change(int tar) {
        int res = 0;
        if (tar == 0) {
            res = 1;
        } else {
            res = 0;
        }
        return res;
    }
}


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