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

#include<stdio.h>
int main(){
char color[10000];
scanf("%s",color);
int count =0;
int countTwo = 0;
for(int i=0;i<10000;i++)
{
	if(color[i]==1||color[i]==0)
	{
	  count++;
	}
}
if(count<=0){
printf(0);
}
else if(count>2){
	if(color[0]==1)
	{
	  for(int j=0;j<=count;j++)
	  {
		  if(j%2==0&&color[j]!=0){
		    countTwo++;
		  }
		  if(j%2!=0&&color[j]!=1){
		    countTwo++;
		  }
	  }
	  printf("%d",countTwo);
	}
	else if(color[0]==0)
	{
	  for(int j=0;j<=count;j++)
	  {
		  if(j%2==0&&color[j]!=1){
		    countTwo++;
		  }
		  if(j%2!=0&&color[j]!=0){
		    countTwo++;
		  }
	  }
	  printf("%d",countTwo);
	}
}

Compiler output:
main.c: In function 'main':
main.c:44:1: error: expected declaration or statement at end of input
   44 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int main()
{
int S[100000];
int N=S.length;
int i,k=0;
for(i=0;i<N;i++)
{
    scanf("%d",&S[i]);
}
for(i=0;i<N-1;i++)
{
if(S[i]==S[i+1]&&S[i]==0)
{
S[i+1]=1;
k++;
}
else if(S[i]==S[i+1]&&S[i]==1)
{
S[i+1]=0;
k++;
}
}
printf("%d\n",k);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: request for member 'length' in something not a structure or union
    6 | int N=S.length;
      |        ^
Language: C

include<stdio.h>
include<string.h>
define S 100
main()
{
  int a[S];
  int m,k,n,i;
  m=0;
  k=0;
  printf("你只能输入0或则1");
  get(a);
  n=strlen(a);
  int b[S],c[S];
  for(i=0;i<n;i++)
  {
      if(i%2==0)
           {
               b[i]=1;
               c[i]=0;
               
           }
      else
         {
              b[i]=0; 
              c[i]=1;  
         }
  }
   for(i=0;i<n;i++)
     {
         if(a[i]!=b[i])
               m++;
     }
   for(i=0;i<n;i++)
     {
         if(a[i]!=c[i])
               k++;
     }
   if(m<k)
        printf("%d",m);
  else
        printf("%d",k);  
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

include<stdio.h>
include<string.h>
define S 100
main()
{
  int a[S];
  int m,k,n,i;
  m=0;
  k=0;
  printf("你只能输入0或则1");
  get(a);
  n=strlen(a);
  int b[S],c[S];
  for(i=0;i<n;i++)
  {
      if(i%2==0)
           {
               b[i]=1;
               c[i]=0;
               
           }
      else
         {
              b[i]=0; 
              c[i]=1;  
         }
  }
   for(i=0;i<n;i++)
     {
         if(a[i]!=b[i])
               m++;
     }
   for(i=1;i<n;i++)
     {
         if(a[i]!=c[i])
               k++;
     }
   if(m<k)
        printf("%d",m);
  else
        printf("%d",k);  
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

include<stdio.h>
include<string.h>
define S 100
main()
{
  int a[S];
  int m,k,n,i;
  m=0;
  k=0;
  printf("你只能输入0或则1")
  get(a);
  n=strlen(a);
  int b[S],c[S];
  for(i=0;i<n;i++)
  {
      if(i%2==0)
           {
               b[i]=1;
               c[i]=0;
               
           }
      else
         {
              b[i]=0; 
              c[i]=1;  
         }
  }
   for(i=1;i<n;i++)
     {
         if(a[i]!=b[i])
               m++;
     }
   for(i=0;i<n;i++)
     {
         if(a[i]!=c[i])
               k++;
     }
   if(m<k)
        printf("%d",m);
  else
        printf("%d",k);  
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include<stdio.h>
int main()
{
int S[];
int N=S.length;
int i,k=0;
for(i=0;i<N;i++)
{
    scanf("%d",&S[i]);
}
for(i=0;i<N-1;i++)
{
if(S[i]==S[i+1]&&S[i]==0)
{
S[i+1]=1;
k++;
}
else if(S[i]==S[i+1]&&S[i]==1)
{
S[i+1]=0;
k++;
}
printf("%d\n",k);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:5: error: array size missing in 'S'
    4 | int S[];
      |     ^
main.c:5:8: error: request for member 'length' in something not a structure or union
    5 | int N=S.length;
      |        ^
main.c:25:1: error: expected declaration or statement at end of input
   25 | }
      | ^
Language: C

include<stdio.h>
include<string.h>
define S 100
main()
{
  int a[S];
  int m,k,n,i;
  m=0;
  k=0;
  printf("你只能输入0或则1")
  get(a);
  n=strlen(a);
  int b[S],c[S];
  for(i=0;i<n;i++)
  {
      if(i%2==0)
           {
               b[i]=1;
               c[i]=0;
               
           }
      else
         {
              b[i]=0; 
              c[i]=1;  
         }
  }
   for(i=1;i<n;i++)
     {
         if(a[i]!=b[i])
               m++;
     }
   for(i=1;i<n;i++)
     {
         if(a[i]!=c[i])
               k++;
     }
   if(m<k)
        printf("%d",m);
  else
        printf("%d",k);  
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include<stdio.h>

int main()
{
   char a[100000];
   int i,j,x,y;
   scanf("%s".&a[0]);
   i=0,j=0,x=0,y=0;
   while(a[i] !='/0')
   {
       if(a[i] !='0' || a[i] != '1')
       {
          scanf("%c",&a[i]);
          i--; 
        }
       i++; 
   }

   while(a[j] !='/0')
   {
       if (i > 1)
          if(a[j] == a[j+1] && a[j] == '0')
          {
               a[j]='1';
               x++;
           }
       if(i>1)
          if(a[j] == a[j+1] && a[j] == '1')
          {
               a[j]='0';
               y++;
          }
        j++;
   }
   if(i == 1)
        printf("0/n");
   else
   {
        if(x>=y)
              printf("%d",y);
        else
              printf("%d",x);
    }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:15: error: expected identifier before '&' token
    7 |    scanf("%s".&a[0]);
      |               ^
main.c:9:17: warning: multi-character character constant [-Wmultichar]
    9 |    while(a[i] !='/0')
      |                 ^~~~
main.c:19:17: warning: multi-character character constant [-Wmultichar]
   19 |    while(a[j] !='/0')
      |                 ^~~~
Language: C

include<stdio.h>
include<string.h>
define S 100
main()
{
  int a[S];
  int m,k,n,i;
  m=0;
  k=0;
  printf("你只能输入0或则1")
  get(a);
  n=strlen(a);
  int b[S],c[S];
  for(i=0;i<n;i++)
  {
      if(i%2==0)
           {
               b[i]=1;
               c[i]=0 ;
               
           }
      else
         {
              b[i]=0; 
              c[i]=1;  
         }
  }
   for(i=1;i<n;i++)
     {
         if(a[i]!=b[i])
               m++;
     }
   for(i=1;i<n;i++)
     {
         if(a[i]!=c[i])
               k++;
     }
   if(m<k)
        printf("%d",m);
  else
        printf("%d",k);  
}


Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include<stdio.h>

int main()
{
   char s[100000];
   int i,j,x,y;
   scanf("%s",s);
   i=0,j=0,x=0,y=0;
   while(a[i] !="/0")
   {
       if(a[i] !='0' || a[i] != '1')
       {
          scanf("%c",&a[i]);
          i--; 
        }
       i++; 
   }

   while(a[j] !="/0")
   {
       if (i > 1)
          if(a[j] == a[j+1] && a[j] == '0')
          {
               a[j]='1';
               x++;
           }
       if(i>1)
          if(a[j] == a[j+1] && a[j] == '1')
          {
               a[j]="0";
               y++;
          }
        j++;
   }
   if(i == 1)
        printf("0/n");
   else
   {
        if(x>=y)
              printf("%d",y);
        else
              printf("%d",x);
    }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:10: error: 'a' undeclared (first use in this function)
    9 |    while(a[i] !="/0")
      |          ^
main.c:9:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
int main()
{
  char  ci[10];
  int a,sum;
  for(a=0;a<10;a++)
  scanf("%s",ci[a]);
  char *p=ci; 
  int i=strlen(ci);
  for(a=0;a<i-1;a++)
{
  if(*(p+a)==*(p+a+1))
   {
     sum+=1;
     if(*(p+a)=='1')
      *(p+a+1)='0';
    else 
     *(p+a+1)='1';
}
printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:22:1: error: expected declaration or statement at end of input
   22 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
int main()
{
  char  ci[10];
  gets(ci);
  getchar();
  char *p=ci;
  int a,sum=0; 
  int i=strlen(ci);
  for(a=0;a<i-1;a++)
{
  if(*(p+a)==*(p+a+1))
   {
     sum+=1;
     if(*(p+a)=='1')
      *(p+a+1)='0';
    else 
     *(p+a+1)='1';
}
printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |   gets(ci);
      |   ^~~~
      |   fgets
main.c:22:1: error: expected declaration or statement at end of input
   22 | }
      | ^
Language: C

#include<studio.h>
main()
{
char str[7];
int i;A
int count1=0;
int count2=0;
scanf("%s",str);
if(str[0]==1){
	for(i=1;str[i]='\0';i=i+2)
	{
		if(str[i]==0){
		count1++;
		}
	}
		for(i=2;str[i]='\0';i=i+2)
	{
		if(str[i]==0){
		count1++;
		}
	}
	}
if(str[0]==0){
	for(i=1;str[i]='\0';i=i+2)
	{
		if(str[i]==1){
		count2++;
		}
		
	}

	for(i=2;str[i]='\0';i=i+2)
	{
		if(str[i]==0){
		count2++;
		}
		
	}
	}
printf("%d %d",count1,count2);
}

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

#include<stdio.h>
#include<string.h>
int main()
{
  char  ci[10];
  gets(ci[10]);
  char *p=ci;
  int a,sum=0; 
  int i=strlen(ci);
  for(a=0;a<i-1;a++)
{
  if(*(p+a)==*(p+a+1))
   {
     sum+=1;
     if(*(p+a)=='1')
      *(p+a+1)='0';
    else 
     *(p+a+1)='1';
}
printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |   gets(ci[10]);
      |   ^~~~
      |   fgets
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
int main()
{
  char  ci[10];
  scanf("%s",&ci);
  char *p=ci;
  int a,sum=0; 
  int i=strlen(ci);
  for(a=0;a<i-1;a++)
{
  if(*(p+a)==*(p+a+1))
   {
     sum+=1;
     if(*(p+a)=='1')
      *(p+a+1)='0';
    else 
     *(p+a+1)='1';
}
printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
int main()
{
  char  ci[10];
  scanf("%s",ci);
  char *p=ci;
  int a,sum=0; 
  int i=strlen(ci);
  for(a=0;a<i-1;a++)
{
  if(*(p+a)==*(p+a+1))
   {
     sum+=1;
     if(*(p+a)=='1')
      *(p+a+1)='0';
    else 
     *(p+a+1)='1';
}
printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
int main()
{
  char  ci[10];
  gets(ci);
  char *p=ci;
  int a,sum=0; 
  int i=strlen(ci);
  for(a=0;a<i-1;a++)
{
  if(*(p+a)==*(p+a+1))
   {
     sum+=1;
     if(*(p+a)=='1')
      *(p+a+1)='0';
    else 
     *(p+a+1)='1';
}
printf("%d",sum);
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |   gets(ci);
      |   ^~~~
      |   fgets
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C

#include<stdio.h>
void main()
{
int s[1:100000];
int n,i;
i=1;n=0;
scanf("%d",&s);
while(s[i]='/0')
{
if(s[i]==s[i+1])
{
   if(s[i+1]==0){s[i+1]==1;n++;}
   else{s[i+1]==0;n++;}
}
}
printf("%d",n);

}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: expected ']' before ':' token
    4 | int s[1:100000];
      |        ^
      |        ]
main.c:7:13: error: 's' undeclared (first use in this function)
    7 | scanf("%d",&s);
      |             ^
main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:12: warning: multi-character character constant [-Wmultichar]
    8 | while(s[i]='/0')
      |            ^~~~
Language: C

#include<stdio.h>
void main()
{
int s[1:100000];
int n,i;
i=1;n=0;
scanf("%d",s);
while(s[i]='/0')
{
if(s[i]==s[i+1])
{
   if(s[i+1]==0){s[i+1]==1;n++;}
   else{s[i+1]==0;n++;}
}
}
printf("%d",n);

}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: expected ']' before ':' token
    4 | int s[1:100000];
      |        ^
      |        ]
main.c:7:12: error: 's' undeclared (first use in this function)
    7 | scanf("%d",s);
      |            ^
main.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:12: warning: multi-character character constant [-Wmultichar]
    8 | while(s[i]='/0')
      |            ^~~~
Language: C

#include<stdio.h>
main()
{
int s[1:100000],n,i;
i=1;n=0;
scanf("%d",s);
while(s[i]='')
{
if(s[i]==s[i+1])
{
   if(s[i+1]==0){s[i+1]==1;n++;}
   else{s[i+1]==0;n++;}
}
}
printf("%d",n);

}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:4:8: error: expected ']' before ':' token
    4 | int s[1:100000],n,i;
      |        ^
      |        ]
main.c:5:1: error: 'i' undeclared (first use in this function)
    5 | i=1;n=0;
      | ^
main.c:5:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:5: error: 'n' undeclared (first use in this function)
    5 | i=1;n=0;
      |     ^
main.c:6:12: error: 's' undeclared (first use in this function)
    6 | scanf("%d",s);
      |            ^
main.c:7:12: error: empty character constant
    7 | while(s[i]='')
      |            ^~
Language: C

#include<studio.h>
main()
{
int s[1:100000],n,i;
i=1;n=0;
scanf("%d",s);
while(s[i]='')
{
if(s[i]==s[i+1])
{
   if(s[i+1]==0){s[i+1]==1;n++;}
   else{s[i+1]==0;n++;}
}
}
printf("%d",n);

}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String st = sc.next();
		String[] s = st.split("");
		int count01 = 0; int  count10 = 0; boolean sw = true;
		for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		}
		System.out.println(Math.min(count01,count10));

		sc.close();
	}
}

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

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
int main(){
  string s;
  cin >> s;
  int s0=0;
  int s1=0;
  rep(i,n){
    if(int(s[i])-i%2 != 0) s0++;
    else s1++;
  }
  cout << min(s0,s1) << endl;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'n' was not declared in this scope
    9 |   rep(i,n){
      |         ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i=0;i<(n);++i)
      |                                  ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
int main(){
  string s;
  cin >> s;
  int s0=0;
  int s1=0;
  rep(i,n){
    if(s[i]-i%2 != 0) s0++;
    else s1++;
  }
  cout << min(s0,s1) << endl;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'n' was not declared in this scope
    9 |   rep(i,n){
      |         ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i=0;i<(n);++i)
      |                                  ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
int main(){
  string s;
  cin >> s;
  int s0=0, s1=0;
  rep(i,n){
    if(s[i]-i%2 != 0) s0++;
    else s1++;
  }
  cout << min(s0,s1) << endl;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'n' was not declared in this scope
    8 |   rep(i,n){
      |         ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i=0;i<(n);++i)
      |                                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  
  string str;
  cin >> str;
  
  int sum1 = 0 ;
  int sum2 = 0 ;
  
  for(int i = 0 ; i < N ; i++){
    if(i % 2 == 0){
      if(str.at(i) != 0){
        sum1++ ;
      }
    }else{
      if(str.at(i) != 1){
        sum1++ ;
      }
    }
  }
  
  for(int i = 0 ; i < N ; i++){
    if(i % 2 == 0){
      if(str.at(i) != 1){
        sum2++ ;
      }
    }else{
      if(str.at(i) != 0){
        sum2++ ;
      }
    }
  }
  
  cout << min(sum1 , sum2) << endl;
  
}
  

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++){
      |                       ^
a.cc:23:23: error: 'N' was not declared in this scope
   23 |   for(int i = 0 ; i < N ; i++){
      |                       ^
Language: C++

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

int main(){
  strig S;
  cin >> S;
  int N = S.size();
  int dif_S0 = 0;
  int dif_S1 = 0;
  
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      if(S.at(i) == '1'){
        dif_S0++;
      }
    } else {
      if(S.at(i) == '0'){
        dis_S0++;
      }
    }
  }
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      if(S.at(i) == '1'){
        dif_S1++;
      }
    } else {
      if(S.at(i) == '0'){
        dif_S1++;
      }
    }
  }
  
  cout << min(dif_S0, dif_S1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'strig' was not declared in this scope
    5 |   strig S;
      |   ^~~~~
a.cc:6:10: error: 'S' was not declared in this scope
    6 |   cin >> S;
      |          ^
a.cc:18:9: error: 'dis_S0' was not declared in this scope; did you mean 'dif_S0'?
   18 |         dis_S0++;
      |         ^~~~~~
      |         dif_S0
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

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

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

N, K = map(int, input().split())
S = input()
 
counts = [0]
if S[0] == "0":
	counts.append(0)
last_char = S[0]
for s in S:
	if s == last_char:
		counts[-1] += 1
	else:
		counts.append(1)
		last_char = s
if S[-1] == "0":
	counts.append(0)
l, r = 0, K * 2 + 1
max_count = last_count = sum(counts[l:r])
while True:
	l, r = l + 2, r + 2
	if len(counts) < r:
		break
	count = last_count - (counts[l - 1] + counts[l - 2]) + (counts[r - 1] + counts[r - 2])
	max_count = max(max_count, count)
	last_count = count
print(max_count)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, K = map(int, input().split())
      | ^
Language: C++

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

int main () {

        int n=0,i, a1=0,a2=0 ,ans;
        char s[100000]="", tmp[2]="";

        scanf("%s", s);
        n = strlen(s);

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

                tmp[0] = s[i];

                if(atoi(&tmp) == (i+1)%2)
                {
                        a1++;
                }
                else
                {
                        a2++;
                }
        }

        if( a1 <= a2 )
        {
                ans = a1;
        }
        else
        {
                ans = a2;
        }

        printf( "%d\n", ans);

        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'atoi' was not declared in this scope
   17 |                 if(atoi(&tmp) == (i+1)%2)
      |                    ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  int N=S.size();
  vector<char> q;
  for(int i=0;i<N;i++){
    q.push_back(S.at(i));
  }
  int ans1=0;
  int ans2=0;
  vector<char> a,b;
  for(int j=0;j<N;j++){
    if(j%2==0){
      a.push_back('1');
    }else{
      a.push_back('0');
    }
  }
  for(int k=0;k<N;k++){
    if(k%2==0){
      b.push_back('0');
    }else{
      b.push_back('1');
    }
  }
  for(int l=0;l<N;l++){
    if(q.at(l)!=a.at(l)){
      ans1++;
    }
  }
  for(int m=0;m<N;m++){
    if(q.at(m)!=b.at(m)){
      ans2++;
    }
  }
  cout << min(ans1,ans2) << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:38:34: error: expected '}' at end of input
   38 |   cout << min(ans1,ans2) << endl;
      |                                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

#include<stdio.h>
int main(void)
{ char i[100000];
  scanf("%s",&i);
 int count=0;
 int j;
   for(j=1;j<strlen(i);j++)
   { if(i[j]==i[j-1] && i[j]=='1')
     { i[j]='0';count++;}
    if(i[j]==i[j-1] && i[j]=='0')
     { i[j]='1';count++;}
   }
 printf("%d",count);
 return 0;

Compiler output:
main.c: In function 'main':
main.c:7:14: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    7 |    for(j=1;j<strlen(i);j++)
      |              ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | int main(void)
main.c:7:14: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    7 |    for(j=1;j<strlen(i);j++)
      |              ^~~~~~
main.c:7:14: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:14:2: error: expected declaration or statement at end of input
   14 |  return 0;
      |  ^~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
 
int main(void){

  int s[100001];
  int a=0,b=0,n,i;
  
  scanf("%s",s);
  n=strlen(s);
  
  for(i=0;i<n;i+=2){
    if(s[i]==0){
      s[i]=1;
      a++;
    }
    if(s[i+1]==1){
      s[i+1]=0;
      a++;
    }
  }
  
    for(i=0;i<n;i+=2){
    if(s[i]==1){
      s[i]=0;
      b++;
    }
    if(s[i+1]==0){
      s[i+1]=1;
      b++;
    }
  }
  
    if(a<=b)
      printf("%d\n",a);
  else
    printf("%d\n",b);
   
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: cannot convert 'int*' to 'const char*'
   10 |   n=strlen(s);
      |            ^
      |            |
      |            int*
In file included from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
int a;
char s[1000000];
scanf("%s",s);

    int ans=0;
    int count=0;
    int final=100000;
    for (int ch = 0; ch < 2; ch++) {
      ans=0;
      count=0;
      while (s[count]!='\0') {
        if(ch==0){
          if(s[count]=='0' && count%2==0){ans+=1;}
          else if(s[count]=='1' && count%2==1){ans+=1;}
        }
        else　if(ch==1){
          if(s[count]=='1' && count%2==0){ans+=1;}
          else if(s[count]='0' && count%2==1){ans+=1;;}
        }
        count++;
      }
      if(final>=ans)final=ans;

    }

    printf("%d\n",final);


  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:13: error: stray '\343' in program
   19 |         else<U+3000>if(ch==1){
      |             ^~~~~~~~
Language: C++

#include <iostream>
//#include <fstream>
//#include <vector>
#include <string>

using namespace std;
using ul = unsigned long;



int main(int argc, const char * argv[]) {
//            ifstream in("input.txt");
//            cin.rdbuf(in.rdbuf());
    
    string S;
    cin >> S;
    
    ul n = S.length();
    ul num0 = 0;
    ul num1 = 0;
//    auto g = S[0];
    for (ul i=0; i<n; ++i)
    {
        if (i%2==0 && (int)(S[i] - '0')==1)
        {
            num1 += 1;
        }
        else if (i%2==0 && (int)(S[i] - '0')==0)
        {
            num0 += 1;
        }
        else if (i%2==1 && (int)(S[i] - '0')==1)
        {
            num0 += 1;
        }
        else if (i%2==1 && (int)(S[i] - '0')==0)
        {
            num1 += 1;
        }
        else{
            assert("error!!");
        }
    }
    
    cout << min(num0, num1) << endl;
    
    
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:41:13: error: 'assert' was not declared in this scope
   41 |             assert("error!!");
      |             ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 | #include <iostream>
  +++ |+#include <cassert>
    2 | //#include <fstream>
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: 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:14: 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:14: 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(void){
  int i,a=0;
  string s;
  cin >> s;
  for (i=0;i<s.size();i++) if ((int)s.at(i)-(int)'0'==i%2) a++;
  cout << min(a,s.size()-a) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: 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:14: 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:14: 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(void){
  int i,a=0;
  string s;
  cin >> s;
  for (i=0;i<s.size();i++) if ((int)(s.at(i)-'0')==i%2) a++;
  cout << min(a,s.size()-a) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: 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:14: 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:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    8 |   cout << min(a,s.size()-a) << endl;
      |           ~~~^~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main() {
  string s;
  cin >> s;
  int cnt=0;
  for(int i=0; i<s.size(); i++) {
    if(i%2==s[i]-'0') {
      cnt++;
    }
  }
  cout << min(cnt,s.size()-cnt) << 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(cnt,s.size()-cnt) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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(cnt,s.size()-cnt) << 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,
                 from a.cc:2:
/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(cnt,s.size()-cnt) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  string s;
  cin >> s;
  int cnt=0;
  for(int i=0; i<s.size(); i++) {
    if(i%2==s[i]-'0') {
      cnt++;
    }
  }
  cout << min(cnt,s.size()-cnt) << 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(cnt,s.size()-cnt) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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(cnt,s.size()-cnt) << 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,
                 from a.cc:2:
/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(cnt,s.size()-cnt) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  string S;
  cin >> S;
  int B=0,W=0,c=S.size()%2;
  if(c){
    if(S.at(0)=='1') W++;
    else B++;
  }
  for(int i=c; i<S.size(); i+=2){
    if(S.at(i)=='1') B++;
    else W++;
    if(S.at(i+1)=='1') W++;
    else B++;
  }
  cout << S.size()-max(B,W) << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string S;
      |   ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> S;
      |   ^~~
a.cc:6:10: error: 'S' was not declared in this scope
    6 |   cin >> S;
      |          ^
a.cc:18:3: error: 'cout' was not declared in this scope
   18 |   cout << S.size()-max(B,W) << endl;
      |   ^~~~
a.cc:18:20: error: 'max' was not declared in this scope
   18 |   cout << S.size()-max(B,W) << endl;
      |                    ^~~
a.cc:18:32: error: 'endl' was not declared in this scope
   18 |   cout << S.size()-max(B,W) << endl;
      |                                ^~~~
Language: C++

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

int main() {
  string S;
  cin >> S;
  int suma=0,sumb=0;
  for(int i=0;i<S.length(),i++){
    if(i%2==0){
      if(S[i]=='0')suma++;
      else sumb++;
    }
    else{
      if(S[i]=='0')sumb++;
      else suma++;
    }
  }
  cout << min(suma,sumb);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: expected ';' before ')' token
    8 |   for(int i=0;i<S.length(),i++){
      |                               ^
      |                               ;
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

    int n = s.size();
    int res = 1<<29 /*とりあえずの大きい数字(2^29) */

    for(int start = 0; start <=1; start++) {
        int val = start; /*startは0か1 */
        int count = 0;
        for(int i = 0; i < n; i++) {
            if(s[i] - '0' != start){
                count++;
            }
            val = 1 - val; /*0と1をスイッチする */
        }
        res = min(res, count); /*回答の更新 */
    }

    cout << res << endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected ',' or ';' before 'for'
   12 |     for(int start = 0; start <=1; start++) {
      |     ^~~
a.cc:12:24: error: 'start' was not declared in this scope
   12 |     for(int start = 0; start <=1; start++) {
      |                        ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;

int main()
{
	int i=0,ans=0,N;
	string str;
	cin>>str;
	N=str.size();
	if(N!=1){
	while(i<N){
		i++;
		if(str[i]==str[i-1]){
			ans++;
			i++;
			while((str[i]!=str[i-1])&&(i<N)){
				ans++;
				i++;
				}
			}
		}
	}
	}
	cout<<min(ans,N-ans);
			
	return 0;
}


Compiler output:
a.cc:27:9: error: 'cout' does not name a type
   27 |         cout<<min(ans,N-ans);
      |         ^~~~
a.cc:29:9: error: expected unqualified-id before 'return'
   29 |         return 0;
      |         ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;cin >> s;
  int n = s.length(),cnt=0;
  for(int i=0;i<n;i++)if(s[i]-'0' == i%2)cnt++;
  cout << min(count,n-count);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
    7 |   cout << min(count,n-count);
      |                     ~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i = stoi(s, 0, 2);
  int sum1 = (i & 0x55555555) + ( (i>>1) & 0x55555555);
  sum1 = (sum1 & 0x33333333) + ( (sum1>>2) &0x33333333);
  sum1 = (sum1 & 0x0f0f0f0f) + ( (sum1>>4) & 0x0f0f0f0f);
  sum1 = (sum1 & 0x00ff00ff) + ( (sum1>>8) & 0x00ff00ff);
  sum1 = (sum1 & 0x0000ffff) + (sum1 >>> 16);
  
  cout << max(sum1,s.length()-sum1);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:40: error: expected primary-expression before '>' token
   11 |   sum1 = (sum1 & 0x0000ffff) + (sum1 >>> 16);
      |                                        ^
a.cc:13:14: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
   13 |   cout << max(sum1,s.length()-sum1);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:13:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   13 |   cout << max(sum1,s.length()-sum1);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:13:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   13 |   cout << max(sum1,s.length()-sum1);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  int count=0;
  char s;
  for(int i=0; i<s.size(); i++){
    cin >> s[i];
  }
  if(s.size()==1){
    cout << 0 << endl;
  }else{
  	for(int i=1; i<s.size(); i++){
    	if(s[i]==s[i-1]){
      		if(s[i-1]=='0'){
        		s[i]='1';
        		count += 1;
      		}else{
        		s[i]='0';
        		count += 1;
    		}
  		}
  	}
  }
  cout << count << endl;
}
      

      


Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: request for member 'size' in 's', which is of non-class type 'char'
    7 |   for(int i=0; i<s.size(); i++){
      |                    ^~~~
a.cc:8:13: error: invalid types 'char[int]' for array subscript
    8 |     cin >> s[i];
      |             ^
a.cc:10:8: error: request for member 'size' in 's', which is of non-class type 'char'
   10 |   if(s.size()==1){
      |        ^~~~
a.cc:13:26: error: request for member 'size' in 's', which is of non-class type 'char'
   13 |         for(int i=1; i<s.size(); i++){
      |                          ^~~~
a.cc:14:13: error: invalid types 'char[int]' for array subscript
   14 |         if(s[i]==s[i-1]){
      |             ^
a.cc:14:19: error: invalid types 'char[int]' for array subscript
   14 |         if(s[i]==s[i-1]){
      |                   ^
a.cc:15:21: error: invalid types 'char[int]' for array subscript
   15 |                 if(s[i-1]=='0'){
      |                     ^
a.cc:16:26: error: invalid types 'char[int]' for array subscript
   16 |                         s[i]='1';
      |                          ^
a.cc:19:26: error: invalid types 'char[int]' for array subscript
   19 |                         s[i]='0';
      |                          ^