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

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
	string st;
	cin >> st;
	int num_0 = 0;
	int num_1 = 0;
	char ch;
	for (int i = 0; i < st.length; ++i) {
		ch = st[i];
		if (ch == '0') num_0++;
		if (ch == '1') num_1++;
	}
	cout << min(num_0, num_1) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: 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 '()' ?)
   11 |         for (int i = 0; i < st.length; ++i) {
      |                             ~~~^~~~~~
      |                                      ()
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#define int long long;
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:18: error: declaration does not declare anything [-fpermissive]
    4 | #define int long long;
      |                  ^~~~
a.cc:10:9: note: in expansion of macro 'int'
   10 |         int A1 = 0;
      |         ^~~
a.cc:10:13: error: 'A1' was not declared in this scope
   10 |         int A1 = 0;
      |             ^~
a.cc:4:18: error: declaration does not declare anything [-fpermissive]
    4 | #define int long long;
      |                  ^~~~
a.cc:11:9: note: in expansion of macro 'int'
   11 |         int A2 = 0;
      |         ^~~
a.cc:11:13: error: 'A2' was not declared in this scope
   11 |         int A2 = 0;
      |             ^~
a.cc:4:18: error: declaration does not declare anything [-fpermissive]
    4 | #define int long long;
      |                  ^~~~
a.cc:12:13: note: in expansion of macro 'int'
   12 |         for(int i = 0;i < S.size();i++) {
      |             ^~~
a.cc:12:17: error: 'i' was not declared in this scope
   12 |         for(int i = 0;i < S.size();i++) {
      |                 ^
a.cc:12:35: error: expected ')' before ';' token
   12 |         for(int i = 0;i < S.size();i++) {
      |            ~                      ^
      |                                   )
a.cc:12:36: error: 'i' was not declared in this scope
   12 |         for(int i = 0;i < S.size();i++) {
      |                                    ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    string st;
    cin >> st;
    stack<char> s; /*stackを用意 */

    int res = 0;
    for(int i = 0; i < s.size(); i++) {
        if(s.empty() || s.top() == s[i]){
            s.push(s[i]);
        } /*stackが空もしくはtopと同じ(=消せない)時はstackに足してく */
        else{
            res += 2;
            s.pop();
        }
    } /*topと違うものが来たらカウントに2を足して、stackのtopを除く */
    cout << res << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: no match for 'operator[]' (operand types are 'std::stack<char>' and 'int')
   14 |         if(s.empty() || s.top() == s[i]){
      |                                     ^
a.cc:15:21: error: no match for 'operator[]' (operand types are 'std::stack<char>' and 'int')
   15 |             s.push(s[i]);
      |                     ^
Language: C++

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

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

    int n, r, b;
    n = s.size();
    r = 0; b = 0;
    for (int i = 0; i < n; i++){
        if (s[i] == '0') r += 1;
        else b += 1;
    }
    cout << 2 * fmin(r, b) << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >>s;
  int r=0;
  int c1=0;
  char top=s.at(0);
  for (int i=0;i<s.size();i++){
    if (s.at(i)==top)r++;
    else if (r>0)c1++;
  }
  
  reverse(s.begin(),s.end())
  r=0;
  int c2=0;
  top=s.at(0);
  for (int i=0;i<s.size();i++){
    if (s.at(i)==top)r++;
    else if (r>0)c2++;
  }
  
  
  cout <<max(c1*2,c2*2)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: expected ';' before 'r'
   15 |   reverse(s.begin(),s.end())
      |                             ^
      |                             ;
   16 |   r=0;
      |   ~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;
int main(){
  char s[100002], count=0;
  int len, i;
  len=strlen(s);
  for(i=0;i<len;i++){
    if(s[i]=='0')count++;
  }
  cout << min(count, len-count);
  return 0;
}


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

#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int main(){
  char s[100002], count=0;
  int len, i;
  len=strlen(s);
  for(i=0;i<len;i++){
    if(s[i]=='0')count++;
  }
  cout << min(count, len-count);
  return 0;
}


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

#ifdef PROBLEM_ABC120_C  //コンテスト番号と問題番号

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

int main() {
	char S[100001];
	cin >> S;

	int cnt_0 = 0;
	int cnt_1 = 0;
	size_t len = strlen(S);

	for (int i = 0; i < len; i++) {
		if (S[i] == '0')
			cnt_0++;
		else if (S[i] == '1')
			cnt_1++;
	}

	cout << 2 * min(cnt_0, cnt_1) << endl;

	return 0;
}


Compiler output:
a.cc:1: error: unterminated #ifdef
    1 | #ifdef PROBLEM_ABC120_C  //コンテスト番号と問題番号
Language: C++

typedef long long ll;
const int mod=1e9+7;
using namespace std;
string s;
int main () {
    cin >> s ;
    int a,b;
    a=b=0;
    int k=s.length();
    lol(i,k){
        if(s[i]=='0')a++;
        if(s[i]=='1')b++;
    }
    cout << min(a,b)*2<< endl;
}
 
 

Compiler output:
a.cc:4:1: error: 'string' does not name a type
    4 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> s ;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | typedef long long ll;
a.cc:6:12: error: 's' was not declared in this scope
    6 |     cin >> s ;
      |            ^
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     lol(i,k){
      |         ^
a.cc:10:5: error: 'lol' was not declared in this scope; did you mean 'll'?
   10 |     lol(i,k){
      |     ^~~
      |     ll
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << min(a,b)*2<< endl;
      |     ^~~~
a.cc:14:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:13: error: 'min' was not declared in this scope; did you mean 'main'?
   14 |     cout << min(a,b)*2<< endl;
      |             ^~~
      |             main
a.cc:14:26: error: 'endl' was not declared in this scope
   14 |     cout << min(a,b)*2<< endl;
      |                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | typedef long long ll;
Language: C++

#include <bits/stdc++.h>
using namespace std;
tring s;
int main () {
    cin >> s ;
    int a,b;
    a=b=0;
    int k=s.length();
    lol(i,k){
        if(s[i]=='0')a++;
        if(s[i]=='1')b++;
    }

Compiler output:
a.cc:3:1: error: 'tring' does not name a type
    3 | tring s;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:5:12: error: 's' was not declared in this scope
    5 |     cin >> s ;
      |            ^
a.cc:9:9: error: 'i' was not declared in this scope
    9 |     lol(i,k){
      |         ^
a.cc:9:5: error: 'lol' was not declared in this scope; did you mean 'logl'?
    9 |     lol(i,k){
      |     ^~~
      |     logl
a.cc:12:6: error: expected '}' at end of input
   12 |     }
      |      ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

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

int main(){
    string S;  cin >> S;
    int n = S.length()
    int r = 0, b = 0;
    for(int i=0; i<n; i++){
        if(S[i]=='0') r++;
        if(S[i]=='1') b++;
    }
    cout << 2*min(r, b) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected ',' or ';' before 'int'
    7 |     int r = 0, b = 0;
      |     ^~~
a.cc:9:23: error: 'r' was not declared in this scope
    9 |         if(S[i]=='0') r++;
      |                       ^
a.cc:10:23: error: 'b' was not declared in this scope
   10 |         if(S[i]=='1') b++;
      |                       ^
a.cc:12:19: error: 'r' was not declared in this scope
   12 |     cout << 2*min(r, b) << endl;
      |                   ^
a.cc:12:22: error: 'b' was not declared in this scope
   12 |     cout << 2*min(r, b) << endl;
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef long long ll;

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

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

#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef long long ll;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: request for member 'size' in 'S', which is of non-class type 'int'
   10 |     for(int i=0;i<S.size();i++){
      |                     ^~~~
a.cc:11:14: error: request for member 'at' in 'S', which is of non-class type 'int'
   11 |         if(S.at(i) == '0') cnt = cnt + 1;
      |              ^~
a.cc:13:27: error: request for member 'size' in 'S', which is of non-class type 'int'
   13 |     cout << 2 * min(cnt,S.size() - cnt) << endl;
      |                           ^~~~
Language: C++

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

int main() {
	string s;
	int ans = 0, zeros = 0, ones = 0;
	cin >> s;
	for (int i = 0; i < n; i++) {
		if(s[i] == '0')
			zeros++;
		else
			ones++;
	}
	ans = min(zeros, ones);
	cout << ans << endl;
	return 0;
}

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

#include<stdio.h>
int main(void){
  
  int i, count0, count1, ans;
  char S[100000];
  scanf("%s",S);

  count0 = count1 = ans = 0;
  for(i = 0; S[i] != '\0'; i++){
    if(S[i] == '1'){
      counta++;
    } else {
      countb++;
    }
  }
  
  ans = (count0 >= count1) ? count1: count0;
  printf("%d\n", 2 * ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:7: error: 'counta' undeclared (first use in this function); did you mean 'count1'?
   11 |       counta++;
      |       ^~~~~~
      |       count1
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:7: error: 'countb' undeclared (first use in this function); did you mean 'count1'?
   13 |       countb++;
      |       ^~~~~~
      |       count1
Language: C++

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

#define ll long long
#define P pair<int, int>
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define LAST(x) (x)[(x).size() - 1]
#define GI(name) \
  int(name);     \
  scanf("%d", &(name))
#define GI2(name1, name2) \
  int(name1), (name2);    \
  scanf("%d %d", &(name1), &(name2))
#define GI3(name1, name2, name3) \
  int(name1), (name2), (name3);  \
  scanf("%d %d %d", &(name1), &(name2), &(name3))
#define GVI(name, size)    \
  vector<int>(name)(size); \
  FOR(i, (size)) scanf("%d", &(name)[i])
#define GS(name) \
  string(name);  \
  cin >> (name);
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

string to_string(string s) {
  return s;
}

template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  FOR(i, v.size() - 1) { ret += to_string(v[i]) + ","; }
  if (v.size() > 0) {
    ret += to_string(LAST(v));
  }
  ret += "}";
  return ret;
}

void debug() {
  cerr << endl;
}

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

void print() {
  cout << endl;
}

template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head) << " ";
  print(tail...);
}

int main() {
  GS(S);
  int r = 0, b = 0;
  FOR(i, S.size()) {
    if (S[i] == '0') {
      r++;
    } else {
      g++;
    }
  }
  print(S.size() - abs(r - g));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:82:7: error: 'g' was not declared in this scope
   82 |       g++;
      |       ^
a.cc:85:28: error: 'g' was not declared in this scope
   85 |   print(S.size() - abs(r - g));
      |                            ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 's' was not declared in this scope
    8 |   for(int i=0;i<(int)s.length();++i)
      |                      ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   ans=min(a,b)*2;
      |   ^~~
      |   abs
Language: C++

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

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:16:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   ans=min(a,b)*2;
      |   ^~~
      |   abs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before ')' token
    9 |   for(int i=0;i<n,i++){
      |                      ^
      |                      ;
a.cc:12:11: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |       cout++;
      |       ~~~~^~
Language: C++

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

int main(){
string s; cin >> s;
int cntZero=0, cntOne=0;
for(int i=0;i<s.size();i++){
if(s.at(i)==‘0’) cntZero++;
else cntOne++;
}
cout << 2* min(cntZero, cntOne) << endl;
}

Compiler output:
a.cc:8:13: error: extended character ‘ is not valid in an identifier
    8 | if(s.at(i)==‘0’) cntZero++;
      |             ^
a.cc:8:13: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:13: error: '\U000020180\U00002019' was not declared in this scope
    8 | if(s.at(i)==‘0’) cntZero++;
      |             ^~~
Language: C++

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

int main(){
   string s; cin >> s;
   int cntZero=0, cntOne=0;
   for(int i=0;i<s.size();i++){
      if(s[i]==‘0’) cntZero++;
      else cntOne++;
   }
   cout << 2* min(cntZero, cntOne) <<endl;
}

Compiler output:
a.cc:8:16: error: extended character ‘ is not valid in an identifier
    8 |       if(s[i]==‘0’) cntZero++;
      |                ^
a.cc:8:16: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:16: error: '\U000020180\U00002019' was not declared in this scope
    8 |       if(s[i]==‘0’) cntZero++;
      |                ^~~
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
  char s[100000];
  scnaf("%s", s);
  
  int len;
  len = strlen(s);
  
  int i, j;
  int cnt = 0;
  for(i = 0;i < len; i++){
    if((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')){
      cnt++;
      for(j = i; j < len; j += 2){
        if(s[j + 2] != '\0'){
          s[j] = s[j + 2];
        }
        else{
          s[j] = '\0';
          break;
        }
        if(s[j + 3] != '\0'){
          s[j + 1] = s[j + 3];
        }
        else{
          s[j + 1] = '\0';
          break;
        }
      }
      i--;
      len -= 2;
    }
  }
  
  printf("%d\n", cnt * 2);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |   scnaf("%s", s);
      |   ^~~~~
      |   scanf
Language: Java

import java.util.*;
import java.io.*;

public class Main{
 public static void main(String[] args){
 Scanner s = new Scanner(System.in);
   String str = s.nextLine();
   int k;
   
   for(int i=0; i<str.length(); i++){
    if(str.charAt(i)=='0'){
    k++;
    }
   }
  System.out.print(Math.min(k, (int)str.length()-k));
   
 }
  
  
}

Compiler output:
Main.java:12: error: variable k might not have been initialized
    k++;
    ^
Main.java:15: error: variable k might not have been initialized
  System.out.print(Math.min(k, (int)str.length()-k));
                            ^
2 errors
Language: C++

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

int main(){
  string S;
  cin >> S;
  int _0 = 0,_1 = 0;
  for(int n = 0;n < S.size();n++){
    if(S[n] == '0')_0++;
    else _1++;
  }
  cout << 2*min(_1,_0) << endl;
  return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |   return;
      |   ^~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main (){
  int N;
  cin >> N;
  
  vector<char> A(N);
  int cntz = 0;
  int cnto = 0;
  for(int i = 0; i < N; i++){
    int a;
    cin >> a;
    if(a == '0')cntz++;
    if(a == '1')cnto++;
  }
  ans = 2 *  min(cntz,cnto);
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |   ans = 2 *  min(cntz,cnto);
      |   ^~~
      |   abs
Language: C++

#include <iostream>
#include <vector>

using namespcace std;

int main (){
  int N;
  cin >> N;
  
  vector<char> A(N);
  int cntz = 0;
  int cnto = 0;
  for(int i = 0; i < N; i++){
    int a;
    cin >> a;
    if(a == '0')cntz++;
    if(a == '1')cnto++;
  }
  ans = 2 *  min(cntz,cnto);
  
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'namespcace'
    4 | using namespcace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector<char> A(N);
      |   ^~~~~~
a.cc:10:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:10:10: error: expected primary-expression before 'char'
   10 |   vector<char> A(N);
      |          ^~~~
a.cc:19:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |   ans = 2 *  min(cntz,cnto);
      |   ^~~
      |   abs
a.cc:19:14: error: 'min' was not declared in this scope; did you mean 'std::min'?
   19 |   ans = 2 *  min(cntz,cnto);
      |              ^~~
      |              std::min
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:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

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

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

#include <bits/stdc++.h>

using namespace std;

int main()
{
 	string s;
  cin>>s;
  int zeros=0,ones=0;
  for(int i=0; i<s.size(); i++)
  {
   if(s[i]==1)
   {
     ones++;
  }
    else
    {
     zeros++; 
    }
    int pomal=min(zeros,ones);
    cout<<pomal*2<<endl;
    return 0;
}

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

#include<stdio.h>

int main(){
  char a[];
  int i,ichi=0,zero=0;
  for(i=0;;i++){
    scanf("%c",a[i]);
    if(a[i]==1){
      ichi++;
    }else if(a[i]==0){
      zero++;
    }else{
      break;
    }
  }
  if(ichi<zero){
    printf("%d",ichi);
  }else{
    printf("%d",zero);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: array size missing in 'a'
    4 |   char a[];
      |        ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int N = s.length();
    int count = 0;
    String s1;
    String s2;
    boolean frag=true;
    while(frag){
      	frag = false;
      	if(N <= 1){
          break;
        }
      	if(N == 2){
          if(s.charAt(0) == s.charAt(1)){
            count+=2;
          }
          break;
        }
    	for(int i=0; i<N; i++){
     		if(s.charAt(i)==s.charAt(i+1)){
              if(i==0){
                s=s.substring(2);
              }else{
                s1 = s.substring(0, i);
        		s2 = s.substring(i+2);
        		s = s1 + s2;
              }
        		count += 2;
        		N -= 2;
              frag = ture;
              	break;
      		}
    	}
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:33: error: cannot find symbol
              frag = ture;
                     ^
  symbol:   variable ture
  location: class Main
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int N = s.length();
    int count = 0;
    String s1;
    String s2;
    boolean frag=true;
    while(frag){
      	if(N =< 1){
          break;
        }
      	if(N == 2){
          if(s.charAt(0) == s.charAt(1)){
            count+=2;
          }
          break;
        }
    	for(int i=0; i<N; i++){
     		if(s.charAt(i)==s.charAt(i+1)){
              if(i==0){
                s=s.substring(2);
              }else{
                s1 = s.substring(0, i);
        		s2 = s.substring(i+2);
        		s = s1 + s2;
              }
        		count += 2;
        		N -= 2;
              	break;
      		}
    	}
      	frag = false;
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:12: error: illegal start of type
      	if(N =< 1){
      	        ^
Main.java:12: error: ';' expected
      	if(N =< 1){
      	         ^
2 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int N = s.length();
    int count = 0;
    String s1;
    String s2;
    boolean frag=true;
    while(frag){
      	if(N=<1){
          break;
        }
      	if(N==2){
          if(s.charAt(0) == s.charAt(1)){
            count+=2;
          }
          break;
        }
    	for(int i=0; i<N; i++){
     		if(s.charAt(i)==s.charAt(i+1)){
              if(i==0){
                s=s.substring(2);
              }else{
                s1 = s.substring(0, i);
        		s2 = s.substring(i+2);
        		s = s1 + s2;
              }
        		count += 2;
        		N -= 2;
              	break;
      		}
    	}
      	frag = false;
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:12: error: illegal start of type
      	if(N=<1){
      	      ^
Main.java:12: error: ';' expected
      	if(N=<1){
      	       ^
2 errors
Language: C++

#include "stdafx.h"
#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <functional>
#include <queue>
#include <random>
#include <map>
#include<iomanip>

//AtCoderC++.cpp

using namespace std;


#define rep(i,from,to) for(int i=from;i<to;i++)
#define ints(name,n) vector<int> name;name.resize(n)

template<typename T> void Show(vector<vector<T>> v, string delimiter = " ") {
	for (int i = 0; i < v.size(); i++) {
		for (int j = 0; j < v[i].size(); j++) {
			cout << v[i][j];
			if (j != v[i].size() - 1) {
				cout << delimiter;
			} else {
				cout << endl;
			}
		}
	}
}
template<typename T> void Show(vector<T> v, string delimiter = " ") {
	for (int i = 0; i < v.size(); i++) {
		cout << v[i];
		if (i != v.size() - 1) {
			cout << delimiter;
		} else {
			cout << endl;
		}
	}
}
template<typename T> vector<T> getUniform(T value, int n) {
	vector<vector<T>> ts;
	ts.resize(n);
	for (int i = 0; i < n; i++) {
		ts[i] = value;
	}
	return ts;
}
template<typename T> vector<vector<T>> getUniform(T value, int row, int col) {
	vector<vector<T>> ts;
	ts.resize(row);
	for (int i = 0; i < row; i++) {
		ts[i].resize(col);
		for (int j = 0; j < col; j++) {
			ts[i][j] = value;
		}
	}
	return ts;
}
bool All(vector<vector<bool>> ts) {
	int h = ts.size();
	int w = ts[0].size();
	rep(i, 0, h) {
		rep(j, 0, w) {
			if (!ts[i][j])return false;
		}
	}
	return true;
}



int main() {
	string s;
	cin >> s;
	auto zCount = 0, oCount = 0;
	for (size_t i = 0; i < s.length(); i++) {
		if (s[i] == '0')zCount++;
		else oCount++;
	}
	cout << min(oCount, zCount) * 2 << endl;
}






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

#include <iostream>
using namespace std;

int main(){
	string s;cin >>s;
  	int num0=0;for(auto&& c:s)if(c=='0')nu0++;
  	int num1=s.size()-num0;
  cout <<min(num0,num1)*2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:45: error: 'nu0' was not declared in this scope; did you mean 'num0'?
    6 |         int num0=0;for(auto&& c:s)if(c=='0')nu0++;
      |                                             ^~~
      |                                             num0
Language: C++

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


int main(){
  string s;
  cin >> s;
  int R_count = 0;
  int B_count = 0;
  for(int i = 0; i < s.size(); i++){
    if(s.[i] == '0') R_count++;
    else B_count++;
  }
  int ans = min(R_count,B_count);
  cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: expected unqualified-id before '[' token
   11 |     if(s.[i] == '0') R_count++;
      |          ^
Language: C

#include<stdio.h>

int main(void)
{
   int n, i, b, g;
   char s[100000];

   scanf("%s",s);

   b=0; g=0;
   for(i=0;s[i]=='0'||s[i]=='1';i++){
        if(s[i]=='0') b=b+1;
        else if(s[i]=='1') g=g+1;
   }

   if(b>g) printf("%d\n",g*2);
   else    printf("%d\n",b*2);

   return 0;
}
~                                                                    
~                                                                    
~                             

Compiler output:
main.c:21:1: error: expected identifier or '(' before '~' token
   21 | ~
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;


int main(){
    int c0, c1;
    c0 = c1 = 0;
    string S;
    cin >> S; 
    for(int i = 0; i < N; i++){
        if(S[i] == '0') c0++;
        else c1++;
    }
    cout << 2*min(c0, c1) << endl;
}

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

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

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

	int zero_num = count(s.begin(), s.end(), '0');

	cout >> min(zero_num, s.length() - zero_num) * 2 >> endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   13 |         cout >> min(zero_num, s.length() - zero_num) * 2 >> endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 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:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   13 |         cout >> min(zero_num, s.length() - zero_num) * 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:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   13 |         cout >> min(zero_num, s.length() - zero_num) * 2 >> endl;
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

void solve() {
	string s;
	cin >> s;
	stack<char> ret;
	int ans = 0;
	for(int i = 0; i < s.size(); i++) {
		if(ret.size() && ret.top() != s[i]) {
			ret.pop();
			ans += 2;
		}
		else {
			ret.push(s[i]);
		}
	}
	cout << ans << endl;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:23:9: error: 'stack' was not declared in this scope
   23 |         stack<char> ret;
      |         ^~~~~
a.cc:12:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
   11 | #include <set>
  +++ |+#include <stack>
   12 | #include <string>
a.cc:23:15: error: expected primary-expression before 'char'
   23 |         stack<char> ret;
      |               ^~~~
a.cc:26:20: error: 'ret' was not declared in this scope
   26 |                 if(ret.size() && ret.top() != s[i]) {
      |                    ^~~
Language: C

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

int main(void)
{
        int a, b, c, x, i;
        char n[99999];

        scanf("%s", n);
        a = strlen(n);
        for(i=0;i<a;i++) {
                if(n[i]=='0') b++;
                else c++;
        }
        if(b>c) x=c*2;
        else x=b*2;
        printf("%d\n", x)
        return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:26: error: expected ';' before 'return'
   17 |         printf("%d\n", x)
      |                          ^
      |                          ;
   18 |         return 0;
      |         ~~~~~~
Language: C

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

int main(void)
{
        int a, b, c, x, i;
        char n[99999];

        scanf("%s", n);
        a = strlen(n);
        for(i=0;i<a;i++) {
                if(n[i]=='0') b++;
                else c++;
        }
        if(b>c) x=c*2;
        else x=b*2;
        prinf("%d\n", x);
        return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:9: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |         prinf("%d\n", x);
      |         ^~~~~
      |         printf
Language: C++

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

int main()
{
int i,o=0,z=0;
  char a[100000];
  cin >> a;
  for(i=0;(a[i]=='0')||(a[i]=='1');i++)
  {
  if(a[i]=='0')z++;
  if(a[i]=='1')o++
  }    
  cout << 2*min(z,o) <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected ';' before '}' token
   13 |   if(a[i]=='1')o++
      |                   ^
      |                   ;
   14 |   }
      |   ~
Language: C++

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

int main()
{
int i,a[100001],o=0,z=0;
  for(i=0;i<100001;i++)a[i]=2;
  in >> a;
  for(i=0;a[i]!=2;i++)
  {
  if(a[i]==0)z++;
  if(a[i]==1)o++
  }    
  cout << 2*min(z,o) <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'in' was not declared in this scope; did you mean 'i'?
    9 |   in >> a;
      |   ^~
      |   i
a.cc:13:17: error: expected ';' before '}' token
   13 |   if(a[i]==1)o++
      |                 ^
      |                 ;
   14 |   }
      |   ~
Language: C++

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

Compiler output:
a.cc:17:3: error: 'cout' does not name a type
   17 |   cout << 2*a;
      |   ^~~~
a.cc:18:3: error: expected unqualified-id before 'return'
   18 |   return 0;
      |   ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

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

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] == "0")
a.cc:12:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     else if(s[i] == "1")
a.cc: At global scope:
a.cc:17:3: error: 'cout' does not name a type
   17 |   cout << 2*a;
      |   ^~~~
a.cc:18:3: error: expected unqualified-id before 'return'
   18 |   return 0;
      |   ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main()
{
  string s;
  int count=0;
  cin >> s;
  for(int i=1; i<size.s(); i++){
    for(int j=i-1; j<i; j++){
      if(s[i]==0 && s[j]==1){
        s.erase(j, i);
        count++;
      }
      if(s[i]==1 && s[j]==0){
        s.erase(j, i);
        count++;
      }
    }
  }
  cout << count;
  return 0;
}
      
      

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: overloaded function with no contextual type information
    9 |   for(int i=1; i<size.s(); i++){
      |                       ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main()
{
  string s;
  int count=0;
  cin >> s;
  for(int i=1; i<size.s(), i++){
    for(int j=i-1; j<i, j++){
      if(s[i]==0 && s[j]==1){
        s.erase(j, i);
        count++;
      }
      if(s[i]==1 && s[j]==0){
        s.erase(j, i);
        count++;
      }
    }
  }
  cout << count;
  return 0;
}
      
      

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: overloaded function with no contextual type information
    9 |   for(int i=1; i<size.s(), i++){
      |                       ^
a.cc:9:31: error: expected ';' before ')' token
    9 |   for(int i=1; i<size.s(), i++){
      |                               ^
      |                               ;
a.cc:10:28: error: expected ';' before ')' token
   10 |     for(int j=i-1; j<i, j++){
      |                            ^
      |                            ;
Language: C

#define min(a,b) a<b?a:b
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",min(sum,len-sum)*2);
}


Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'gers' [-Wimplicit-function-declaration]
    7 |     gers(a);
      |     ^~~~
main.c:8:13: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    8 |     int len=strlen(a);
      |             ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | #define min(a,b) a<b?a:b
main.c:8:13: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    8 |     int len=strlen(a);
      |             ^~~~~~
main.c:8:13: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:12:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |     printf("%d\n",min(sum,len-sum)*2);
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | #define min(a,b) a<b?a:b
main.c:12:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   12 |     printf("%d\n",min(sum,len-sum)*2);
      |     ^~~~~~
main.c:12:5: note: include '<stdio.h>' or provide a declaration of 'printf'