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



import java.util.Scanner;

public class C120 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int zero = 0;
        int ichi = 0;
        for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '0') zero++;
            else ichi++;
        }
        int res = 2 * Math.min(zero, ichi);
        System.out.println(res);
    }
}


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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n;
string s;
cin>>s;
n=s.size();
ll ca=0;
ll cb=0;
for(ll i=0; i<n; i++){
if(s.at(i)=='1'){
ca++}
else{
cb++;}}
cout<<min(ca,cb)*2<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: expected ';' before '}' token
   28 | ca++}
      |     ^
      |     ;
Language: C++

int main()
{
  	string s;
  	cin>>s;
  	int z=0,o=0;
  	for(int i=0;i<s.length();i++)
    {
    	if(s[i]=='0')
          z++;
      	else
          o++;
    }
  	cout<<min(z,o)*2;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'string' was not declared in this scope
    3 |         string s;
      |         ^~~~~~
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin>>s;
      |         ^~~
a.cc:4:14: error: 's' was not declared in this scope
    4 |         cin>>s;
      |              ^
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout<<min(z,o)*2;
      |         ^~~~
a.cc:13:15: error: 'min' was not declared in this scope; did you mean 'main'?
   13 |         cout<<min(z,o)*2;
      |               ^~~
      |               main
Language: C++

#include <bits/stdc++.h>
#include<algorithm>//next_permutation
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rrepa(i,a,n) for(int i=n-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define vc vector
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;


int main (){
    string s;
    cin >> s;
    int n 
    int z =0,o;
    rep(i,n){
        if(s[i]=='0')z++;
    }
    o = n-z;
    cout << min(o,z)*2 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: expected initializer before 'int'
   30 |     int z =0,o;
      |     ^~~
a.cc:31:11: error: 'n' was not declared in this scope
   31 |     rep(i,n){
      |           ^
a.cc:5:33: note: in definition of macro 'rep'
    5 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                 ^
a.cc:32:22: error: 'z' was not declared in this scope
   32 |         if(s[i]=='0')z++;
      |                      ^
a.cc:34:5: error: 'o' was not declared in this scope
   34 |     o = n-z;
      |     ^
a.cc:34:9: error: 'n' was not declared in this scope
   34 |     o = n-z;
      |         ^
a.cc:34:11: error: 'z' was not declared in this scope
   34 |     o = n-z;
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()

int main(){
    int S;
    cin >> S;
    int c0 = count(all(S),'0');
    int c1 = count(all(S),'1');
    int cm=min(c0,c1);
    cout << 2*cm << endl;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:4:18: error: request for member 'begin' in 'S', which is of non-class type 'int'
    4 | #define all(v) v.begin(), v.end()
      |                  ^~~~~
a.cc:9:20: note: in expansion of macro 'all'
    9 |     int c0 = count(all(S),'0');
      |                    ^~~
a.cc:4:29: error: request for member 'end' in 'S', which is of non-class type 'int'
    4 | #define all(v) v.begin(), v.end()
      |                             ^~~
a.cc:9:20: note: in expansion of macro 'all'
    9 |     int c0 = count(all(S),'0');
      |                    ^~~
a.cc:4:18: error: request for member 'begin' in 'S', which is of non-class type 'int'
    4 | #define all(v) v.begin(), v.end()
      |                  ^~~~~
a.cc:10:20: note: in expansion of macro 'all'
   10 |     int c1 = count(all(S),'1');
      |                    ^~~
a.cc:4:29: error: request for member 'end' in 'S', which is of non-class type 'int'
    4 | #define all(v) v.begin(), v.end()
      |                             ^~~
a.cc:10:20: note: in expansion of macro 'all'
   10 |     int c1 = count(all(S),'1');
      |                    ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define INF 100000000
typedef long long ll;
 
int main(){
    string s;
    cin>>s;
    ll o=0;
    ll z=0;
    rep(i,0,N){
        if(s[i]=='0')z++;
        else if(s[i]=='1')o++;
    }
    cout<<min(o,z)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'N' was not declared in this scope
   13 |     rep(i,0,N){
      |             ^
a.cc:3:68: note: in definition of macro 'rep'
    3 | #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
      |                                                                    ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define INF 100000000
typedef long long ll;
 
int main(){
    string s;
    cin>>s;
    ll o=0;
    ll z=0;
    rep(i,0,N){
        if(s[i]=='0')z++;
        else if(s[i]=='1')o++;
    }
    cout<<min(o.,z)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'N' was not declared in this scope
   13 |     rep(i,0,N){
      |             ^
a.cc:3:68: note: in definition of macro 'rep'
    3 | #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
      |                                                                    ^~~
a.cc:17:17: error: expected unqualified-id before ',' token
   17 |     cout<<min(o.,z)<<endl;
      |                 ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: no matching function for call to 'min(int&, size_t)'
   10 |   cout << 2*min(c,strlen(s)-c);
      |             ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:10:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'size_t' {aka 'long unsigned int'})
   10 |   cout << 2*min(c,strlen(s)-c);
      |             ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:10:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   10 |   cout << 2*min(c,strlen(s)-c);
      |             ~~~^~~~~~~~~~~~~~~
Language: Java

import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		char[] s = new Scanner(System.in).next().toCharArray();
		int[] arr = {0,0};
		
		for(char c : s){
		if(c == '1')arr[1]++;
		else arr[0]++;
		}
		
		
		System.out.println(2*Math.min(arr[0],arr[1]));
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Compiler output:
Main.java:18: error: cannot find symbol
		saori.close();
		^
  symbol:   variable saori
  location: class Main
1 error
Language: C++

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

    int n = s.length();
    int no0 = 0;
    int no1 = 0;

    rep(i,n){
        if(s[i] == '0') no0++;
        else no1++;
    }

    cout << min(no0,no1)*2 <<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'string' was not declared in this scope
    2 |     string s;
      |     ^~~~~~
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>s;
      |     ^~~
a.cc:3:10: error: 's' was not declared in this scope
    3 |     cin>>s;
      |          ^
a.cc:9:9: error: 'i' was not declared in this scope
    9 |     rep(i,n){
      |         ^
a.cc:9:5: error: 'rep' was not declared in this scope
    9 |     rep(i,n){
      |     ^~~
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << min(no0,no1)*2 <<endl;
      |     ^~~~
a.cc:14:13: error: 'min' was not declared in this scope; did you mean 'main'?
   14 |     cout << min(no0,no1)*2 <<endl;
      |             ^~~
      |             main
a.cc:14:30: error: 'endl' was not declared in this scope
   14 |     cout << min(no0,no1)*2 <<endl;
      |                              ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int l,r;
	string a;int cnt=0,cnt1=0;
	cin>>a;
	for(int i=0;i<=a.size();++i){
		if(a[i]!=a[i+1]){
			a.erase(i,i+1);
			cnt+=2;
		}
		if(a[i]!=a[i-1]){
			a.erase(i,i-1);
			cnt1+=2;
	}
	cout<<cnt<<endl;
} 

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

#include<bits/stdc++.h>
using namespace std;
int main(){
	int l,r;
	string a;int cnt=0,cnt1=0;
	cin>>a;
	for(int i=0;i<=a.size();++i){
		if(a[i]!=a[i+1]){
			a.erase(i,i+1);
			cnt+=2;
		}
		if(a[i]!=a[i-1]){
			a.erase(i,i-1);
			cnt1+=2;
	}
	cout<<max(cnt,cnt1)*2<<endl;
} 

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

import java.util.*;
public class Main {
	public static void main(String[] args){
      String s = sc.next();
      int ans = 0;
      int zero = 0;
      int one = 0;
      for(int i=0;i<s.length();i++){if(s.charAt(i)=='0'){zero++;}
                                   else{one++;}
                                   }
      ans=Math.min(zero,one)*2;
	  System.out.println(ans);
  }
}


Compiler output:
Main.java:4: error: cannot find symbol
      String s = sc.next();
                 ^
  symbol:   variable sc
  location: class Main
1 error
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
      String s = sc.next();
      int ans = 0;
      int zero = 0;
      int one = 0;
      for(int i=0;i<s.length();i++){if(s.charAt(i)=='0'){zero++;}
                                   else{one++;}}
      ans=Math.min(zero,one)*2;
		System.out.println(ans);
  }
}

Compiler output:
Main.java:4: error: cannot find symbol
      String s = sc.next();
                 ^
  symbol:   variable sc
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define step(i, s, n, d) for(int i=s; i<n; i+=d)
#define FOR(i,s,n) step(i,s,n,1)
#define rep(i,n) FOR(i,0,n)
#define ll long long
typedef pair<int, int> P;

int main(){
  ll one, zero;
  string s;
  cin >> s;
  rep(i, s.size()) {
    if (s[i] == '0') {
      zero ++;
    } else {
      one++;
    }
  }
  cout << min(one, zero) * 2)<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: expected ';' before ')' token
   20 |   cout << min(one, zero) * 2)<< endl;
      |                             ^
      |                             ;
Language: C++

#include <bits/stdc++.h>
#define MOD (long long)(1E9+7)
#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

int main(){
	int c[2];
  	c[0] = c[1] = 0;
  	string s;
	cin >> s;
	rep(i, n.size()) {
    	c[s[i] - '0']++;
    }
  	cout << min(c[0], c[1]) << endl;
}

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

#include <iostream>
#include <string>
#include <algorithm>

int main()
{
  int S;
  std::cin>>S;
  
  const int Red='0';
  const int Blue='1';
  int redCount=0;
  int blueCount=0;
  for(auto i=S.crbegin();i!=S.crend();i++)
  {
    if(*i==Red)
    {
      redCount++;
    }
    else
    {
      blueCount++;
    }
  }
  
  std::cout<<(std::min)(redCount,blueCount)/2<<std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: request for member 'crbegin' in 'S', which is of non-class type 'int'
   14 |   for(auto i=S.crbegin();i!=S.crend();i++)
      |                ^~~~~~~
a.cc:14:31: error: request for member 'crend' in 'S', which is of non-class type 'int'
   14 |   for(auto i=S.crbegin();i!=S.crend();i++)
      |                               ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#define ll long long
using namespace std;
int main(){
    string s;
    cin>>s;
    
    int cnt0=0;
    for(int i=0;i<s.length();i++){
        if('0'==s[i]){
            cnt0++;
        }
    }
    int cnt1=s.lengtj()-cnt0;
    cout<<2*min(cnt0,cnt1)<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lengtj'; did you mean 'length'?
   18 |     int cnt1=s.lengtj()-cnt0;
      |                ^~~~~~
      |                length
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int main()
{
    int cnt=0;
    int i;
    scanf("%s",s);
    int len=strlen(s);
    for(i=0;i<=len-1;i++)
    {
        if(cube.empty()||cube.top()==s[i])cube.push(s[i]);
        else
        {
            cube.pop();
            cnt+=2;
        }
    }
    printf("%d",cnt);
    return 0;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    5 |     int main()
      |             ^~
a.cc:5:13: note: remove parentheses to default-initialize a variable
    5 |     int main()
      |             ^~
      |             --
a.cc:5:13: note: or replace parentheses with braces to value-initialize a variable
a.cc:6:1: error: a function-definition is not allowed here before '{' token
    6 | {
      | ^
Language: C++

#include<cstring>
#include<stack>
#include<cmath>
using namespace std;
stack<char>cube;
char s[100005];
int main()
{
    int m=0;
    int i;
    scanf("%s",s);
    int len=strlen(s);
    for(i=0;i<=len-1;i++)
    {
        if(cube.empty()||cube.top()==s[i])cube.push(s[i]);
        else
        {
            cube.pop();
            m+=2;
        }
    }
    printf("%d",m);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'scanf' was not declared in this scope
   11 |     scanf("%s",s);
      |     ^~~~~
a.cc:22:5: error: 'printf' was not declared in this scope
   22 |     printf("%d",m);
      |     ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include<cmath>
  +++ |+#include <cstdio>
    4 | using namespace std;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before ')' token
    7 |   for(i=0;i<s.size(),i++){
      |                         ^
      |                         ;
Language: C++

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

int main(){
    string s;
    cin >> s;
    int a = 0,b = 0;
    rep(i,s,size()){
        if(s[i] == '1')a++;
        else b++;
    }
    cout << min(a,b)*2 << endl;
}


Compiler output:
a.cc:11:19: error: macro "rep" passed 3 arguments, but takes just 2
   11 |     rep(i,s,size()){
      |                   ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i,n) for(int i = 0;i < (n);i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'rep' was not declared in this scope
   11 |     rep(i,s,size()){
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  string s;
  cin >> s;
  cnt0=0;
  cnt1=0;
  ll k=s.size();
  rep(i,k){
    if(s[i]=='1'){
      cnt1++;
    }
    else{
      cnt0++;
    }
  }
  cout << 2*min(cnt1,cnt0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'cnt0' was not declared in this scope
   18 |   cnt0=0;
      |   ^~~~
a.cc:19:3: error: 'cnt1' was not declared in this scope
   19 |   cnt1=0;
      |   ^~~~
Language: C++

#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long 
using namespace std;
int main(){
  string s;
  cin >>s;
  int bl=0;
  int wh=0;
  rep(i,s.size()){
    if(s[i]=='0'){
      wh++;
    }else{
      bl++;
    }
  }
  

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

#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <numeric>
#define rep(i, s, g) for ((i) = (s); (i) < (g); ++(i))
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1ll << 60);

int main(void)
{
    int n;
    string s;

    cin >> s;

    ll count = 0;

    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '0')
        {
            count++;
        }
    }

    cout << min(count, (ll)s.size() - count) * 2 << endl
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:57: error: expected ';' before '}' token
   42 |     cout << min(count, (ll)s.size() - count) * 2 << endl
      |                                                         ^
      |                                                         ;
   43 | }
      | ~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef long double ld;
const double pi=acos(-1.0);
const ll mod=pow(10,9)+7;
const ll INF=pow(2,31)-1;
typedef pair<int,int> P;
typedef vector<int> vi;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

ll gcd(ll a , ll b){
	if(b == 0) return a;
	return gcd(b , a % b);	
}
ll lcm(ll a , ll b){
	ll g = gcd(a , b);
	ll lc = (a/g) * b;
	return lc;
}

int main(){
    ios::sync_with_stdio(false);
    string s; cin >> s;
    ll ans=0;
    while(s.find("10")!=string::npos){
        int place=s.find("10");
        s=s.erase(place,2);
        ans++;

    }
    while(s.find("01")!=string::npos){
        int place2=s.find("01");
        s=s.erase(place2,2);
        ans++;
    }
    cout << 2*ans << endl;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:41:14: error: expected '}' at end of input
   41 |     return 0;
      |              ^
a.cc:25:11: note: to match this '{'
   25 | int main(){
      |           ^
Language: C++

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

int main(){
  string s;
  int one;
  int zero;
  for (char c:s){
    if (c=='1') one++;
    else zero ++;
  cout << min(one,zero)*2 << endl;
}

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

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

int main(){
  string s;
  int one;
  int zero;
  for (char c:s){
    if (c=='1') one++;
    else zero ++;
  cout << min(one,zero) << endl;
}

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

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	s := scanRunes()

	st := []rune{}
	ans := 0
	for i := 0; i < len(s); i++ {
		now := s[i]
		if len(st) != 0 && st[len(st)-1] != now {
			ans += 2
			st = st[0 : len(st)-1]
		} else {
			st = append(st, now)
		}
	}

	fmt.Fprintln(wr, ans)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:13:1: error: 'func' does not name a type
   13 | func scanRunes() []rune    { return []rune(scanString()) }
      | ^~~~
a.cc:14:1: error: 'func' does not name a type
   14 | func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
      | ^~~~
a.cc:15:1: error: 'func' does not name a type
   15 | func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
      | ^~~~
a.cc:16:1: error: 'func' does not name a type
   16 | func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }
      | ^~~~
a.cc:18:1: error: 'func' does not name a type
   18 | func scanInts(n int) []int {
      | ^~~~
a.cc:26:1: error: 'func' does not name a type
   26 | func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }
      | ^~~~
a.cc:26:28: error: expected unqualified-id before ')' token
   26 | func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }
      |                            ^
a.cc:28:1: error: 'func' does not name a type
   28 | func abs(a int) int {
      | ^~~~
a.cc:34:1: error: 'func' does not name a type
   34 | func min(a, b int) int {
      | ^~~~
a.cc:40:1: error: 'func' does not name a type
   40 | func max(a, b int) int {
      | ^~~~
a.cc:48:1: error: 'func' does not name a type
   48 | func main() {
      | ^~~~
Language: C++

#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
  string a;
  int b,c;
  rep(i,a.size()){
    if(s[i]=='0')b++;
    else c++;
  }
  cout<<(max(b,c)-min(b,c))*2;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 's' was not declared in this scope
    9 |     if(s[i]=='0')b++;
      |        ^
Language: C++

#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
  string a;cin>>a;
  if(a.size()%2=0)cout<<0;
  else cout<<1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: lvalue required as left operand of assignment
    7 |   if(a.size()%2=0)cout<<0;
      |      ~~~~~~~~^~
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a; i< (int)(b); ++i)
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
typedef long double ld;
using ll=long long;
using namespace std;
const auto mod=1e9+7;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  
  string s; cin >> s;
  int ans=0;
  rep(i,0,n) if(s[i]=='0') ans++;
  cout << min(ans,s.size()-ans)*2 << endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'n' was not declared in this scope
   18 |   rep(i,0,n) if(s[i]=='0') ans++;
      |           ^
a.cc:2:42: note: in definition of macro 'rep'
    2 | #define rep(i,a,b) for(int i=a; i< (int)(b); ++i)
      |                                          ^
a.cc:19:14: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   19 |   cout << min(ans,s.size()-ans)*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:19:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   19 |   cout << min(ans,s.size()-ans)*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:19:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   19 |   cout << min(ans,s.size()-ans)*2 << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~
Language: C++

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

int main() {
queue<int> red;
queue<int> blue;
string s;
cin >> s;
for(int i=0;i<n;i++){
    if(s[i]=='0')red.push(s[i]);
    if(s[i]=='1')blue.push(s[i]);
}
cout << 2*min(red.size(),blue.size()) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'n' was not declared in this scope
    9 | for(int i=0;i<n;i++){
      |               ^
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 oneCnt = 0;
      int zeroCnt = 0;
      for(char c : s.toString())
        if(c == '0') zeroCnt++;
        else oneCnt++;
      System.out.println(Math.min(zeroCnt, oneCnt) * 2);
  }
}

Compiler output:
Main.java:10: error: for-each not applicable to expression type
      for(char c : s.toString())
                             ^
  required: array or java.lang.Iterable
  found:    String
1 error
Language: C++

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

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

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

#define N 100001

typedef struct _Stack {
	bool isZero[N];
	int num;
} Stack;

void push(Stack *s, bool isZero){
	s->isZero[s->num++] = isZero;
}

bool pop(Stack *s){
	return s->isZero[--s->num];
}

bool top(Stack *s){
	return s->isZero[s->num-1];
}

bool isEmpty(Stack *s){
	return s->num == 0;
}

int main(){
	char c[N];
	int ans = 0;
	Stack s;
	s.num = 0;
	scanf("%s\n", c);
	while(*c){
		bool isZero;
		if(*c == '0') isZero = true;
		else isZero = false;
		if(isEmpty(&s) || top(&s) == isZero) push(&s, isZero);
		else {
			pop(&s);
			ans +=2;
		}
		c++;
	}
	printf("%d", ans);
	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:45:17: error: lvalue required as increment operand
   45 |                 c++;
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18
#define PI 3.14159265358979

using namespace std;

ll gcd(ll a, ll b);
ll power(ll n, ll k);
ll inv(ll n);
ll genfact(ll n, ll k);
ll fact(ll n);
ll nck(ll n, ll k);

int main(void){
  string s;
  cin >> s;
  
  vector<int> a(n, 0);
  int n = s.size();

  int tail = -1;
  for (int i = 0; i < n; i++){
    if (tail == -1){
      tail++;
      a[tail] = s[i];
    }
    else if (a[tail] != s[i]){
      tail--;
    }
    else {
      tail++;
      a[tail] = s[i];
    }
  }

  cout << n - tail - 1 << endl;

  return 0;
}

ll gcd(ll a, ll b){
  if (a < b)
    return gcd(b, a);
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}

ll power(ll n, ll k){
  ll res = 1;
  while(k > 0){
    if (k & 1) 
      res = res * n % MOD;
    n = n * n % MOD;
    k >>= 1;
  }
  return res;
}

ll genfact(ll n, ll k){

  ll res = 1;
  while (k >= 0){
    res = (res * (n - k)) % MOD;
    k--;
  }

  return res;
}

ll inv(ll n){
  return power(n, MOD - 2);
}

ll fact(ll n){
  return genfact(n, n - 1);
}

ll nck(ll n, ll k){
  if (k == 0)
    return 1;
  if (n <= 0)
    return 0;

  return ((genfact(n, k) % MOD) * inv(fact(k))) % MOD;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'n' was not declared in this scope
   20 |   vector<int> a(n, 0);
      |                 ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: 'n' was not declared in this scope
    7 |     for(int i = 0; i < n; i++) cnt[s[i]-'0']++;
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
 	string s;
  	cin >> s;
  	stack<char>st;
  	int ans = 0;
  	for(int i = 0 ; i < n ; i++)
    {
     	if(s[i] == '0')
        {
         	if(st.size() && st.top() == '1'){
              	ans += 2;
              	st.pop();
            }
          	else{
             	 st.push(s[i]);
            }
        }
      	else{
          	if(st.size() && st.top() == '0'){
              	ans += 2;
              	st.pop();
            }
          	else{
             	 st.push(s[i]);
            }
        }
    }
  	cout << ans << endl;
	return 0;
}

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

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

int main() {
    string s;
    cin>>s;
    int z=o=0;
    for (auto c:s) {
        if (c=='0')
            z++;
        else o++;
    }
    cout<<min(z,o)*2<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'o' was not declared in this scope
    8 |     int z=o=0;
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	string s;
  	cin >> s;
  	int ones = 0;
  	ones = count(s.begin(),s.end(),'1');
  	cout << min(2*ones, 2*(s.size()-ones))<<'\n';

	return 0;
}

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

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

int main() 
{
	string s; cin>>s;
	int one=0,zero=0;
	for(char c: s)
	{
		if(c=='1')
		{
			one++
		}
		else
		{
			zero++;
		}
	}
	cout<<min(one,zero)*2;
	


}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: expected ';' before '}' token
   12 |                         one++
      |                              ^
      |                              ;
   13 |                 }
      |                 ~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int S;
	cin >> S;
	int N = S.size();
	
	int zeroCount = 0;
	int oneCount = 0;
	
	for (int i = 0; i < N; i++)
	{
		if (S[i] == 0)
		{
			zeroCount++;
		}
		else {
			oneCount++;
		}
	}
	
	// 2 * (0のカウント数と1のカウント数のどちらかの最小値)で取り除けるキューブの数が求まる。
	int answer = 2 * min(zeroCount, oneCount);
	// 出力
	cout << answer << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: request for member 'size' in 'S', which is of non-class type 'int'
   10 |         int N = S.size();
      |                   ^~~~
a.cc:17:22: error: invalid types 'int[int]' for array subscript
   17 |                 if (S[i] == 0)
      |                      ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

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

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

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

#include <iostream>
#include <string>
#include <math.h>

int main(void)
{
    int m=0,n=0;
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]=='0') m++;
        else n++;
    }
    cout<<2*min(m,n);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope
    8 |     string s;
      |     ^~~~~~
a.cc:8:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |     cin>>s;
      |     ^~~
      |     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:10: error: 's' was not declared in this scope
    9 |     cin>>s;
      |          ^
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |     cout<<2*min(m,n);
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   15 |     cout<<2*min(m,n);
      |             ^~~
      |             std::min
In file included from /usr/include/c++/14/string:51:
/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: Java

import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		int N = S.length();
		int a = 0,b = 0;
		for( int i=0; i<N; i++ ){
			if( S.charAti(i)=='0' ){
				a++;
			}else{
				b++;
			}
		}
		System.out.println(Math.min(a,b)*2);
	}
}


Compiler output:
Main.java:11: error: cannot find symbol
			if( S.charAti(i)=='0' ){
			     ^
  symbol:   method charAti(int)
  location: variable S of type String
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define fs first
#define sc second
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<tuple<ll,ll>> vtl;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

void solve(){
    //abc120c
    string s;
    cin>>s;
    ll ans,minr,mini;
    rep(i,n){
      if(s[i]=='0')minr++;
      else mini++;
    }
  ans=min(minr,mini);
    cout<<ans;
}

int main(){
    cout<<std::fixed<<std::setprecision(10);
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:23:11: error: 'n' was not declared in this scope
   23 |     rep(i,n){
      |           ^
a.cc:4:38: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                      ^
Language: Java

public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String a=sc.next();;
		
		int n=a.length();
		int d[]=new int[n];
		int b=0,c=0;
		for(int i=0;i<n;i++) {
			d[i]=a.charAt(i)-48;
			if(d[i]==1)b++;
			else c++;
		}
		c*=2;b*=2;
		if(c<=b) System.out.print(c);
		else System.out.print(b);
	}

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

package test;
import java.util.Scanner;

public class B {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String a=sc.next();;
		
		int n=a.length();
		int d[]=new int[n];
		int b=0,c=0;
		for(int i=0;i<n;i++) {
			d[i]=a.charAt(i)-48;
			if(d[i]==1)b++;
			else c++;
		}
		c*=2;b*=2;
		if(c<=b) System.out.print(c);
		else System.out.print(b);
	}
}

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

package test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class B {
	public static void main(String[] args) throws IOException{
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		String a;
		a=br.readLine();
		int n=a.length();
		int d[]=new int[n];
		int b=0,c=0;
		for(int i=0;i<n;i++) {
			d[i]=a.charAt(i)-48;
			if(d[i]==1)b++;
			else c++;
		}
		c*=2;b*=2;
		if(c<=b) System.out.print(c);
		else System.out.print(b);
	}
}


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