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

main()
{
  char a[100010];
    for(int i=0;i<100010;i++)
      a[i]=0;
    gers(a);
    int len=strlen(a);
    int sum=0;
    for(int i=0;i<100010;i++)
      sum+=a[i]-'0';
    printf("%d\n",(int)fmax(sum*2,(len-sum)*2);
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main()
      | ^~~~
main.c: In function 'main':
main.c:6:5: error: implicit declaration of function 'gers' [-Wimplicit-function-declaration]
    6 |     gers(a);
      |     ^~~~
main.c:7:13: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    7 |     int len=strlen(a);
      |             ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | main()
main.c:7:13: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    7 |     int len=strlen(a);
      |             ^~~~~~
main.c:7:13: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:11:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |     printf("%d\n",(int)fmax(sum*2,(len-sum)*2);
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | main()
main.c:11:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   11 |     printf("%d\n",(int)fmax(sum*2,(len-sum)*2);
      |     ^~~~~~
main.c:11:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:24: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration]
   11 |     printf("%d\n",(int)fmax(sum*2,(len-sum)*2);
      |                        ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax'
  +++ |+#include <math.h>
    1 | main()
main.c:11:24: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch]
   11 |     printf("%d\n",(int)fmax(sum*2,(len-sum)*2);
      |                        ^~~~
main.c:11:24: note: include '<math.h>' or provide a declaration of 'fmax'
main.c:11:47: error: expected ')' before ';' token
   11 |     printf("%d\n",(int)fmax(sum*2,(len-sum)*2);
      |           ~                                   ^
      |                                               )
main.c:11:48: error: expected ';' before '}' token
   11 |     printf("%d\n",(int)fmax(sum*2,(len-sum)*2);
      |                                                ^
      |                                                ;
   12 | }
      | ~
Language: C++

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

int main(){
  int count = 0;
  stack<int> s;
  string S;
  
  cin>>S;
  s.push(S.at(0));
  
  for(i=1;i<S.size();i++){
    if(S.at(i)!=s.top()){
      s.pop();
      count+=2;
    }
  }
  
  cout<<count<<endl;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=1;i<S.size();i++){
      |       ^
Language: C

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

int main(){
	
  int i, count0=0, count1;
  char S[10000];
  
  if(scanf("%s", S)==0) return -1;
  
  count1=strlen(S);
  
  for(i=0:s[i]!='\0';i++){
  	if(S[i]=='0') count0++;
  }
  
  count1-=count0;
  
  if(count1>=count0) printf("%d", count1*2);
  else printf("%d", count0*2);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:10: error: expected ';' before ':' token
   13 |   for(i=0:s[i]!='\0';i++){
      |          ^
      |          ;
main.c:13:25: error: expected ';' before ')' token
   13 |   for(i=0:s[i]!='\0';i++){
      |                         ^
      |                         ;
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<functional>
#include<map>
#include<cmath>

using namespace std;

typedef long long ll;
#define INF 1000000007

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

    int c0 = 0, c1 = 0;
    for(int i = 0; i < l; i++)
    {
        if(s[i] == '0') c0++
        else c1++;
    }

    cout << min(c0, c1) << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: expected ';' before 'else'
   21 |         if(s[i] == '0') c0++
      |                             ^
      |                             ;
   22 |         else c1++;
      |         ~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  int ans = 0;
  int frag = 1;
  int now = 0;
  while(frag) {
    frag = 0;
    if(S.size() == 0 || S.size() == 1) {
      break;
    }
    for(int i = now; i < S.size() - 1; i++) {
      if(S[i] != S[i + 1]) {
        S.erase(S.begin() + i);
        S.erase(S.begin() + i);
        ans++;
        frag = true;
        // cout << "S: " << S << " ans: " << ans << " now: " << now << " i: " << i
             << endl;
        if(i == 0) {
          now = 0;
          break;
        } else {
          now = i - 1;
          break;
        }
      }
      if(S.size() == 0 || S.size() == 1) {
        break;
      }
    }
  }
  cout << ans * 2 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: expected primary-expression before '<<' token
   26 |              << endl;
      |              ^~
Language: C++

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

int main(){
    string l; cin >> l;
    const string S =l;
    int N = S.size();

    int s[100010]; for (int i = 0; i < N; i++) s[i] = atoi(S.at(i));

    int sum_0 = 0, sum_1 = 0;
    for (int i = 0; i < N; i++) {
        if (s[i] = 0) sum_0 ++;
        else sum_1 ++;
    }

    cout << 2*(min(sum_0, sum_1)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:64: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   10 |     int s[100010]; for (int i = 0; i < N; i++) s[i] = atoi(S.at(i));
      |                                                            ~~~~^~~
      |                                                                |
      |                                                                __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

int main(){
    string s; cin >> s;
    const string S =s;
    int N = S.size();

    int s[100010]; for (int i = 0; i < N; i++) s[i] = atoi(S.at(i));

    int sum_0 = 0, sum_1 = 0;
    for (int i = 0; i < N; i++) {
        if (s[i] = 0) sum_0 ++;
        else sum_1 ++;
    }

    cout << 2*(min(sum_0, sum_1)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: conflicting declaration 'int s [100010]'
   10 |     int s[100010]; for (int i = 0; i < N; i++) s[i] = atoi(S.at(i));
      |         ^
a.cc:6:12: note: previous declaration as 'std::string s'
    6 |     string s; cin >> s;
      |            ^
a.cc:10:64: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   10 |     int s[100010]; for (int i = 0; i < N; i++) s[i] = atoi(S.at(i));
      |                                                            ~~~~^~~
      |                                                                |
      |                                                                __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

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

    int s[100010]; for (int i = 0; i < N; i++) s[i] = atoi(S.at(i));

    int sum_0 = 0, sum_1 = 0;
    for (int i = 0; i < N; i++) {
        if (s[i] = 0) sum_0 ++;
        else sum_1 ++;
    }

    cout << 2*(min(sum_0, sum_1)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:64: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    9 |     int s[100010]; for (int i = 0; i < N; i++) s[i] = atoi(S.at(i));
      |                                                            ~~~~^~~
      |                                                                |
      |                                                                __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

int main(){
  string s;
  cin >> s;
  int n=s.size();
  int zero,one;
  int loop_count=1;
  int answer=0;
  while (loop_count!=0){
    loop_count=0;
    zero=0;
    one=0;  
    for (int i=0;i<n;i++){
      if (s[i]=='0'){
        zero++;
        one=0;
      }
      if (s[i]=='1'){
        one++;
        zero=0;
      }
      if (zero==2 || one==2){
        s[i]='2';
        s[i-1]='2';
        loop_count++;
        one=0;
        zero=0;
        count +=2;
      }
    }
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: overloaded function with no contextual type information
   30 |         count +=2;
      |                 ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  int n=s.size();
  int zero,one;
  int loop_count=1;
  int answer=0;
  while (loop_count!=0){
    loop_count=0;
    zero=0;
    one=0;  
    for (int i=0;i<n;i++){
      if (s[i]=='0'){
        zero++;
        one=0;
      }
      if (s[i]=='1'){
        one++;
        zero=0;
      }
      if (zero=2 || one=2){
        s[i]='2';
        s[i-1]='2';
        loop_count++;
        one=0;
        zero=0;
      }
    }
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: lvalue required as left operand of assignment
   24 |       if (zero=2 || one=2){
      |                ~~^~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   13 |   cout << min(s, A.size() - s) * 2 << 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: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 << min(s, A.size() - s) * 2 << 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:13:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   13 |   cout << min(s, A.size() - s) * 2 << endl;
      |           ~~~^~~~~~~~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class ABC120_C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int zeroCount = 0;
        int oneCount = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1') {
                zeroCount++;
            } else {
                oneCount++;
            }
        }

        int notDeletedCount = Math.abs(zeroCount - oneCount);
        int res = S.length() - notDeletedCount;

        System.out.println(res);
    }
}


Compiler output:
Main.java:3: error: class ABC120_C is public, should be declared in a file named ABC120_C.java
public class ABC120_C {
       ^
1 error
Language: Java

package atCoderProblems_ABC_C;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class ABC120_C {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		List<String> sList = Arrays.asList(S.split(""));

		int zeroCount = 0;
		int oneCount= 0;
		int ans = 0;
		for(String s : sList){
			if(s.equals("0")){
				zeroCount++;
			}else{
				oneCount++;
			}
		}

		if(zeroCount>oneCount){
			ans = oneCount*2;
		}else{
			ans = zeroCount*2;
		}

		System.out.println(ans);

	}
}


Compiler output:
Main.java:8: error: class ABC120_C is public, should be declared in a file named ABC120_C.java
public class ABC120_C {
       ^
1 error
Language: C++

#include "stdc++.h"
using namespace std;
int main(){
    string S;
    cin>>S;
    int x=0;
    int y=0;
    for (int i=0;i<S.size();i++){
        if (S.at(i)=='1'){
            x++;
        }
        else{
            y++;
        }
    }
    cout<<S.size()-max(x,y)+min(x,y)<<endl;
}

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

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

int main(){
  string S;
  cin >> S;
  
  int N = S.length();
  int k = 0;
  int t = 0;
  
  int l = 0;
  
  while(k < N){
    if((S[k] == '0' && S[k+1] == '1')||(S[k] == '1' && S[k+1] == '0')){
      S.erase(k, 2);
      l += 2;
      k -= 1;
    }
    else{
      k += 1;
    }
  }
  
  cout << l << endl;

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

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];puts("");}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
// int dx[]={0,1,0,-1};
// int dy[]={1,0,-1,0};//RDLU
#define yes puts("YES")
#define no puts("NO")

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

	string s;
	cin>>s;
	int c=0;
	rep(i,s.size())if(s[i]-'0')c++;
	else c--;
	cout<<n-abs(c)<<endl;
}


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

#include <bits/stdc++.h>

using namespace std;

int main(){
  string s;
  int flag=0,q=0;
  
  cin >> s;
  
  while(flag==0){
    for(int i=0;i<=strlen(s);i++){
      if((str[i]==0 && str[i+1]==1) || str[i]==1 && strt[i+1]==0){
        q+=2;
        for(int j=i;j<=strlen(s)-2;j++)
          str[i]=str[i+2];
      }
      
      else
      	flag=1;
    }
  }
  
  cout << q;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |     for(int i=0;i<=strlen(s);i++){
      |                           ^
      |                           |
      |                           std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:13:11: error: 'str' was not declared in this scope; did you mean 'std'?
   13 |       if((str[i]==0 && str[i+1]==1) || str[i]==1 && strt[i+1]==0){
      |           ^~~
      |           std
a.cc:13:53: error: 'strt' was not declared in this scope; did you mean 'sqrt'?
   13 |       if((str[i]==0 && str[i+1]==1) || str[i]==1 && strt[i+1]==0){
      |                                                     ^~~~
      |                                                     sqrt
a.cc:15:31: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   15 |         for(int j=i;j<=strlen(s)-2;j++)
      |                               ^
      |                               |
      |                               std::string {aka std::__cxx11::basic_string<char>}
/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<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  int N;
  N = S.size();
  int cntred = 0; 
  int cntblue = 0;
  for(int i = 0;i<N;i++){
    if(S.at(i) =='1'){
      cntblue++;
    }
    else{
      cntred++;
    }
  }
  if(cntred=>cntblue){
    cout<<cntblue;
  }
  else{
    cout<<cntred;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: expected primary-expression before '>' token
   18 |   if(cntred=>cntblue){
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  int N = S.size()
  int cntred = 0; 
  int cntblue = 0;
  for(int i = 0;i<N;i++){
    if(S.at(i) =='1'){
      cntblue++;
    }
    else{
      cntred++;
    }
  }
  if(cntred=>cntblue){
    cout<<cntblue;
  }
  else{
    cout<<cntred;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'int'
    7 |   int cntred = 0;
      |   ^~~
a.cc:14:7: error: 'cntred' was not declared in this scope
   14 |       cntred++;
      |       ^~~~~~
a.cc:17:6: error: 'cntred' was not declared in this scope
   17 |   if(cntred=>cntblue){
      |      ^~~~~~
a.cc:17:13: error: expected primary-expression before '>' token
   17 |   if(cntred=>cntblue){
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  N = S.size()
  int cntred = 0; 
  int cntblue = 0;
  for(int i = 0;i<N;i++){
    if(S.at(i) =='1'){
      cntblue++;
    }
    else{
      cntred++;
    }
  }
  if(cntred=>cntblue){
    cout<<cntblue;
  }
  else{
    cout<<cntred;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'N' was not declared in this scope
    6 |   N = S.size()
      |   ^
a.cc:14:7: error: 'cntred' was not declared in this scope
   14 |       cntred++;
      |       ^~~~~~
a.cc:17:6: error: 'cntred' was not declared in this scope
   17 |   if(cntred=>cntblue){
      |      ^~~~~~
a.cc:17:13: error: expected primary-expression before '>' token
   17 |   if(cntred=>cntblue){
      |             ^
Language: C++

include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  N = S.size()
  int cntred = 0; 
  int cntblue = 0;
  for(int i = 0;i<N;i++){
    if(S.at(i) =='1'){
      cntblue++;
    }
    else{
      cntred++;
    }
  }
  if(cntred=>cntblue){
    cout<<cntblue;
  }
  else{
    cout<<cntred;
  }
}

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:4:3: error: 'string' was not declared in this scope
    4 |   string S;
      |   ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>S;
      |   ^~~
a.cc:5:8: error: 'S' was not declared in this scope
    5 |   cin>>S;
      |        ^
a.cc:6:3: error: 'N' was not declared in this scope
    6 |   N = S.size()
      |   ^
a.cc:14:7: error: 'cntred' was not declared in this scope
   14 |       cntred++;
      |       ^~~~~~
a.cc:17:6: error: 'cntred' was not declared in this scope
   17 |   if(cntred=>cntblue){
      |      ^~~~~~
a.cc:17:13: error: expected primary-expression before '>' token
   17 |   if(cntred=>cntblue){
      |             ^
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<cntblue;
      |     ^~~~
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout<<cntred;
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  str S;
  cin>>S;
  N = S.size()
  int cntred = 0; 
  int cntblue = 0;
  for(int i = 0;i<N;i++){
    if(S.at(i) =='1'){
      cntblue++;
    }
    else{
      cntred++;
    }
  }
  if(cntred=>cntblue){
    cout<<cntblue;
  }
  else{
    cout<<cntred;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'str' was not declared in this scope; did you mean 'std'?
    4 |   str S;
      |   ^~~
      |   std
a.cc:5:8: error: 'S' was not declared in this scope
    5 |   cin>>S;
      |        ^
a.cc:6:3: error: 'N' was not declared in this scope
    6 |   N = S.size()
      |   ^
a.cc:14:7: error: 'cntred' was not declared in this scope
   14 |       cntred++;
      |       ^~~~~~
a.cc:17:6: error: 'cntred' was not declared in this scope
   17 |   if(cntred=>cntblue){
      |      ^~~~~~
a.cc:17:13: error: expected primary-expression before '>' token
   17 |   if(cntred=>cntblue){
      |             ^
Language: C++

include<bits/stdc++.h>
using namespace std;
int main(){
  str S;
  cin>>S;
  N = S.size()
  int cntred = 0; 
  int cntblue = 0;
  for(int i = 0;i<N;i++){
    if(S.at(i) =='1'){
      cntblue++;
    }
    else{
      cntred++;
    }
  }
  if(cntred=>cntblue){
    cout<<cntblue;
  }
  else{
    cout<<cntred;
  }
}

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:4:3: error: 'str' was not declared in this scope; did you mean 'std'?
    4 |   str S;
      |   ^~~
      |   std
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>S;
      |   ^~~
a.cc:5:8: error: 'S' was not declared in this scope
    5 |   cin>>S;
      |        ^
a.cc:6:3: error: 'N' was not declared in this scope
    6 |   N = S.size()
      |   ^
a.cc:14:7: error: 'cntred' was not declared in this scope
   14 |       cntred++;
      |       ^~~~~~
a.cc:17:6: error: 'cntred' was not declared in this scope
   17 |   if(cntred=>cntblue){
      |      ^~~~~~
a.cc:17:13: error: expected primary-expression before '>' token
   17 |   if(cntred=>cntblue){
      |             ^
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<cntblue;
      |     ^~~~
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout<<cntred;
      |     ^~~~
Language: C

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

int main()
{
	int i, res;
	char c;
	for(i=0; S[i]!='\0'; i++){
		scanf("%c", &c);
		res += (c-'0')*2-1;
	}
	printf("%d\n", i-abs(res));
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:18: error: 'S' undeclared (first use in this function)
    8 |         for(i=0; S[i]!='\0'; i++){
      |                  ^
main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main()
{
	int i, res;
	char c;
	for(i=0; S[i]!='\0'; i++){
		scanf("%c", c);
		res += (c-'0')*2-1;
	}
	printf("%d\n", i-abs(res));
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:18: error: 'S' undeclared (first use in this function)
    8 |         for(i=0; S[i]!='\0'; i++){
      |                  ^
main.c:8:18: 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(){
	
  stack<char> st;
  string s;cin >> s;
  for(int i=0;i<s.size();i++){
  	
    if(st.size() == 0) st.push(s[i);
    else if(s[i] != st.top()){
    	st.pop();
    }
  }
  cout << s.size()-st.size();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:35: error: expected ']' before ')' token
   11 |     if(st.size() == 0) st.push(s[i);
      |                                   ^
      |                                   ]
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;
  cin>>s;
  int count1=0,count0=0;
  for(int i=0;i<s.length();i++){
    if(s[i]=='0')
      coun0t++;
    if(s[i]=='1')
      count1++;
  }
  int ans=count1<count0? count1:count0;
  cout<<ans*2<<endl;
  return 0;
}

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

#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;
  cin>>s;
  int count1=0,count0=0;
  for(int i=0;i<s.length();i++){
    if(s[i]=='0')
      coun0t++;
    if(s[i]=='1')
      coun1t++;
  }
  int ans=count1<count0? count1:count0;
  cout<<ans*2<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'coun0t' was not declared in this scope; did you mean 'count0'?
   10 |       coun0t++;
      |       ^~~~~~
      |       count0
a.cc:12:7: error: 'coun1t' was not declared in this scope; did you mean 'count1'?
   12 |       coun1t++;
      |       ^~~~~~
      |       count1
Language: C

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

#define S_MAX 100000

int main(){

    char s[S_MAX];
    int len;
    int cnt_0 = 0; 
    int cnt_1 = 0;
    int i;

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

    for(i=0 ; i<len ; i++)[
        if(s[i]=='0'){
            cnt_0++;
        }
        else{
            cnt_1++;
        }
    ]
    
    if(cnt_0 < cnt_1){
        printf("%d", cnt_0*2);
    }
    else{
        printf("%d", cnt_1*2);        
    }

}

Compiler output:
main.c: In function 'main':
main.c:17:27: error: expected expression before '[' token
   17 |     for(i=0 ; i<len ; i++)[
      |                           ^
main.c:24:6: error: expected ';' before 'if'
   24 |     ]
      |      ^
      |      ;
   25 | 
   26 |     if(cnt_0 < cnt_1){
      |     ~~
Language: C

#include <stdio.h>
#include <string.h>
int main (){
int j,i,k=0,d=0;
char s[100002]={0};
  scanf ("%s",s);
  for (i=0;s[i]!=0;i++){
  if (s[i]=='0'){
    k++;
  }
  else {
  d++;
  }  
  if (k>d){
  printf ("%d",k*2);
  }
else {
printf ("%d",d*2);
}
return 0;
}


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

#define REP(i, n) for (int i = 0; i < (n); ++i)

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

using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  long long sum = 0;
  REP(i, s.length) {
      if(s[i] == '0') sum++;
  }
  cout << min({sum, s.length() - sum}) * 2 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: invalid use of member 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]' (did you forget the '()' ?)
   13 |   REP(i, s.length) {
      |            ^
a.cc:1:40: note: in definition of macro 'REP'
    1 | #define REP(i, n) for (int i = 0; i < (n); ++i)
      |                                        ^
a.cc:16:14: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   16 |   cout << min({sum, s.length() - sum}) * 2 << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:3:
/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:   candidate expects 2 arguments, 1 provided
/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, 1 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:   template argument deduction/substitution failed:
a.cc:16:14: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'long long unsigned int')
   16 |   cout << min({sum, s.length() - sum}) * 2 << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
Language: C++

#define REP(i, n) for (int i = 0; i < (n); ++i)

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

using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  long long sum = 0;
  REP(i, s.length) {
      if(s[i] == '0') sum++;
  }
  cout << min({sum, (long long)s.length - sum}) * 2 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: invalid use of member 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]' (did you forget the '()' ?)
   13 |   REP(i, s.length) {
      |            ^
a.cc:1:40: note: in definition of macro 'REP'
    1 | #define REP(i, n) for (int i = 0; i < (n); ++i)
      |                                        ^
a.cc:16:34: error: invalid use of member 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]' (did you forget the '()' ?)
   16 |   cout << min({sum, (long long)s.length - sum}) * 2 << endl;
      |                                ~~^~~~~~
      |                                        ()
a.cc:16:14: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   16 |   cout << min({sum, (long long)s.length - sum}) * 2 << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:3:
/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:   candidate expects 2 arguments, 1 provided
/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, 1 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:   template argument deduction/substitution failed:
/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:   candidate expects 2 arguments, 1 provided
Language: C

#include <stdlib.h>
#include<stdio.h>
struct CELL {
	struct CELL *next;
	int		value;
} header;
 
struct CELL *nthp(int n)
{
	struct CELL *q;
	q = &header;
	int i;
	for (i = 0; i < n; i++)
	{
		q = q->next;
	}
	return q;
}
 
void insert(int n, int value)
{
	struct CELL *new, *q;
	q = nthp(n-1);
	if ((new = malloc(sizeof(struct CELL))) == NULL)
		printf("���������m�ۂł��܂���");
 
	new->value = value;
	new->next = q->next;
	q->next = new;
}
 
void add(int value)
{
	insert(0, value);
}
 
void delete_p(struct cell *q)
{
	struct CELL *p;
	p = q->next;
	q->next = p->next;
	free(p);
}
 
int tumiki(){
  struct CELL *p;
  p = &header;
  int count=0;
  int check=1;
  while(check==1){
    check=0;
    while(p->next->next!=NULL){
      if(p->next->value==p->next->next->value){
        delete_p(p->next);
        delete_p(p->next);
        count=count+2;
        check=1;
      }
      else
        p=p->next;
    }
  }
}
 
int main()
{
  char *s;
  scanf("%s",s);
  int i;
  while(s[i]!='\0'){
  	if(s[i]=='0')
      add(0);
    else
      add (1);
  }
  printf("%d",tumiki());
  return 0;
}

Compiler output:
main.c:37:22: warning: 'struct cell' declared inside parameter list will not be visible outside of this definition or declaration
   37 | void delete_p(struct cell *q)
      |                      ^~~~
main.c: In function 'delete_p':
main.c:40:14: error: invalid use of undefined type 'struct cell'
   40 |         p = q->next;
      |              ^~
main.c:41:10: error: invalid use of undefined type 'struct cell'
   41 |         q->next = p->next;
      |          ^~
main.c: In function 'tumiki':
main.c:54:19: error: passing argument 1 of 'delete_p' from incompatible pointer type [-Wincompatible-pointer-types]
   54 |         delete_p(p->next);
      |                  ~^~~~~~
      |                   |
      |                   struct CELL *
main.c:37:28: note: expected 'struct cell *' but argument is of type 'struct CELL *'
   37 | void delete_p(struct cell *q)
      |               ~~~~~~~~~~~~~^
main.c:55:19: error: passing argument 1 of 'delete_p' from incompatible pointer type [-Wincompatible-pointer-types]
   55 |         delete_p(p->next);
      |                  ~^~~~~~
      |                   |
      |                   struct CELL *
main.c:37:28: note: expected 'struct cell *' but argument is of type 'struct CELL *'
   37 | void delete_p(struct cell *q)
      |               ~~~~~~~~~~~~~^
Language: C

#include <stdlib.h>
#include<stdio.h>
struct CELL {
	struct CELL *next;
	int		value;
} header;

struct CELL *nthp(int n)
{
	struct CELL *q;
	q = &header;
	int i;
	for (i = 0; i < n; i++)
	{
		q = q->next;
	}
	return q;
}

void insert(int n, int value)
{
	struct CELL *new, *q;
	q = nthp(n-1);
	if ((new = malloc(sizeof(struct CELL))) == NULL)
		printf("���������m�ۂł��܂���");

	new->value = value;
	new->next = q->next;
	q->next = new;
}

void add(int value)
{
	insert(0, value);
}

void delete_p(struct cell q)
{
	struct CELL *p;
	p = q->next;
	q->next = p->next;
	free(p);
}

int tumiki(){
	struct cell *p;
  int count=0;
  int check=1;
  p=&header;
  while(check==1){
    check=0;
    while(p->next->next!=NULL){
      if(p->next->value==p->next->next->value){
        delete_p(p->next);
        delete_p(p->next);
        count=count+2;
        check=1;
      }
      else
        p=p->next;
    }
  }
}

int main()
{
  char *s;
  scanf("%s",s);
  int i;
  while(s[i]!='\0'){
  	if(s[i]=='0')
      add(0);
    else
      add (1);
  }
  printf("%d",tumiki());
  return 0;
}

Compiler output:
main.c:37:22: warning: 'struct cell' declared inside parameter list will not be visible outside of this definition or declaration
   37 | void delete_p(struct cell q)
      |                      ^~~~
main.c:37:27: error: parameter 1 ('q') has incomplete type
   37 | void delete_p(struct cell q)
      |               ~~~~~~~~~~~~^
main.c: In function 'tumiki':
main.c:49:4: error: assignment to 'struct cell *' from incompatible pointer type 'struct CELL *' [-Wincompatible-pointer-types]
   49 |   p=&header;
      |    ^
main.c:52:12: error: invalid use of undefined type 'struct cell'
   52 |     while(p->next->next!=NULL){
      |            ^~
main.c:53:11: error: invalid use of undefined type 'struct cell'
   53 |       if(p->next->value==p->next->next->value){
      |           ^~
main.c:53:27: error: invalid use of undefined type 'struct cell'
   53 |       if(p->next->value==p->next->next->value){
      |                           ^~
main.c:54:19: error: invalid use of undefined type 'struct cell'
   54 |         delete_p(p->next);
      |                   ^~
main.c:55:19: error: invalid use of undefined type 'struct cell'
   55 |         delete_p(p->next);
      |                   ^~
main.c:60:12: error: invalid use of undefined type 'struct cell'
   60 |         p=p->next;
      |            ^~
Language: Java

public class CUnification {
    public static void main(String[] args) throws Exception {

    	try(BufferedReader i = new BufferedReader(new InputStreamReader(System.in))){

    		String S = i.readLine();
    		int a = S.length();
    		Long r = S.chars().parallel().filter(c -> c=='0').count();
    		Long b = a - r;
	    	System.out.println(Math.min(r, b) * 2);
    	}
    }
}

Compiler output:
Main.java:1: error: class CUnification is public, should be declared in a file named CUnification.java
public class CUnification {
       ^
Main.java:4: error: cannot find symbol
    	try(BufferedReader i = new BufferedReader(new InputStreamReader(System.in))){
    	    ^
  symbol:   class BufferedReader
  location: class CUnification
Main.java:4: error: cannot find symbol
    	try(BufferedReader i = new BufferedReader(new InputStreamReader(System.in))){
    	                           ^
  symbol:   class BufferedReader
  location: class CUnification
Main.java:4: error: cannot find symbol
    	try(BufferedReader i = new BufferedReader(new InputStreamReader(System.in))){
    	                                              ^
  symbol:   class InputStreamReader
  location: class CUnification
4 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s;
  int i,count;
  cin >>s;
  s = s + "2";
  for(i=0;i<s.size()-2;i++){
    if(s[i] == 2 || s[i+1] == 2)break;
    if(s[i] == 1 && s[i+1] == 0){
      s.erase(i,2);
      i -= 2;
      count += 2
    }else if(s[i] == 0 && s[i+1] == 1){
      s.erase(i,2);
      i -= 2;
      count += 2
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected ';' before '}' token
   14 |       count += 2
      |                 ^
      |                 ;
   15 |     }else if(s[i] == 0 && s[i+1] == 1){
      |     ~            
a.cc:18:17: error: expected ';' before '}' token
   18 |       count += 2
      |                 ^
      |                 ;
   19 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s;
  int i,count;
  cin >>s;
  s = s + "2";
  for(i=0;i<s.size()-2;i++){
    if(s[i] == "2" || s[i+1] == "2")break;
    if(s[i] == "1" && s[i+1] == "0"){
      s.erase(i,2);
      i -= 2;
      count += 2
    }else if(s[i] == "0" && s[i+1] == "1"){
      s.erase(i,2);
      i -= 2;
      count += 2
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(s[i] == "2" || s[i+1] == "2")break;
a.cc:10:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(s[i] == "2" || s[i+1] == "2")break;
a.cc:11:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "1" && s[i+1] == "0"){
a.cc:11:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "1" && s[i+1] == "0"){
a.cc:14:17: error: expected ';' before '}' token
   14 |       count += 2
      |                 ^
      |                 ;
   15 |     }else if(s[i] == "0" && s[i+1] == "1"){
      |     ~            
a.cc:15:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     }else if(s[i] == "0" && s[i+1] == "1"){
a.cc:15:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     }else if(s[i] == "0" && s[i+1] == "1"){
a.cc:18:17: error: expected ';' before '}' token
   18 |       count += 2
      |                 ^
      |                 ;
   19 |     }
      |     ~
Language: C++

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

string s;
int r, b;

int main()
{
    cin >> s;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '0')
            r++ else b++;
    }
    cout << min(a, b) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: expected ';' before 'else'
   14 |             r++ else b++;
      |                ^~~~~
      |                ;
a.cc:16:17: error: 'a' was not declared in this scope
   16 |     cout << min(a, b) << endl;
      |                 ^
Language: C++

#python 3.7.1
s = list(input())
s = [int(i) for i in s]
n = 0
r = 0
b = 0
for i in s:
	if s[n] == 0:
		r += 1
	elif s[n] == 1:
		b += 1
	n += 1
print(min(r,b) * 2)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #python
    1 | #python 3.7.1
      |  ^~~~~~
a.cc:2:1: error: 's' does not name a type
    2 | s = list(input())
      | ^
Language: C

#include <stdio.h>
#include <string.h>
int main(){
  long cal=0;
  char s;
  scanf("%s",&s);
  for (long i=0;i<strlen(s);i++){
    if (s[i]=='0'){
      cal++;
    }
    else {
      cal--;
    }
  }
  if (cal<0){
      cal+=strlen(s);
  }
  else{
      cal=strlen(s)-cal;
  }  
  printf("%ld\n",cal);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:26: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    7 |   for (long i=0;i<strlen(s);i++){
      |                          ^
      |                          |
      |                          char
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:8:10: error: subscripted value is neither array nor pointer nor vector
    8 |     if (s[i]=='0'){
      |          ^
main.c:16:19: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   16 |       cal+=strlen(s);
      |                   ^
      |                   |
      |                   char
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:19:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   19 |       cal=strlen(s)-cal;
      |                  ^
      |                  |
      |                  char
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C

#include <stdio.h>
#include <string.h>
int main(){
  long cal=0;
  char s[100000];
  scanf("%s",&s);
  for (long i=0;i<strlen(s);i++){
    if (s[i]='0'){
      cal++;
    }
    else{
      cal--;
    }
    if (cal<0){
      cal+=strlen(s);
    }
    else{
      cal-=strlen(s);
    }
    printf("%ld\n",cal);
  return 0;
}

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

#include<cstdio>
#include<algorithm>
#include<cstring>
char s[100001];
using namespace std;
int main()
{
    int c0 = 0 , c1 = 0;
    gets(s);
    int n ;
    n = strlen(s);
    for(int i = 0 ; i < n ; i ++)
        if(s[i] == '0')
        c0 ++;
        else
        c1 ++;
    printf("%d" , 2 * min(c0 , c1));
return 0;
}


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