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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    long long cnt=0,sum1=0,sum2=0,tmp=0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='B')
        {
            sum1+=i;
            cnt++;
        }
    }
    for(int i=s.length()-1;i>=0;i--)
    {
       if(cnt==0)break;
        sum2+=i;
        tmp++;
        if(tmp>=cnt)break;
    }
    cout<<max(0,sum2-sum1)<<endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: no matching function for call to 'max(int, long long int)'
   23 |     cout<<max(0,sum2-sum1)<<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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:23:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   23 |     cout<<max(0,sum2-sum1)<<endl;
      |           ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:23:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |     cout<<max(0,sum2-sum1)<<endl;
      |           ~~~^~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,i,k,powerof2,ginlo=0;
    vector<ll> v;
    cin >> n;
    for(i=0;i<n;i++)
    {
        cin >> k;
        v.push_back(k);
    }
    sort(v.begin(),v.end());
    for(i=n-1;i>=0;i--)
    {   powerof2 = 1;
       while (powerof2 < v[i])
       powerof2 <<= 1;
       if(find(v.begin(),v.end(),powerof2-v[i]))
       ginlo++;
    }
    cout<<ginlo;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: could not convert 'std::find<__gnu_cxx::__normal_iterator<long long int*, vector<long long int> >, long long int>(v.std::vector<long long int>::begin(), v.std::vector<long long int>::end(), (powerof2 - v.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))))' from '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' to 'bool'
   19 |        if(find(v.begin(),v.end(),powerof2-v[i]))
      |           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |               |
      |               __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >
Language: C++

#include <cstdio>
#include <cstring>

const int N = 1 << 20;
int n;
char s[N];

int main() {
	gets(s);
	n = strlen(s);
	long long ans = 0;
	int cnt = 0;
	for (int i = 0; i < n; ++ i) {
		if (s[i] == 'W') ans += cnt;
		else cnt ++;
	}
	printf("%lld\n", ans);
	return 0;
}

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

import java.io.*;
import java.util.*;
public class agc029_a{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long ans = 0;
		long b = 0;
		for(int i=0; i<s.length(); i++)
			if(s.charAt(i)=='B') 
				b += 1;
			else
				ans += b;
		System.out.println(ans);
	}
}

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

#include<iostream>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<vector>
using namespace std;
using ll = long long;
using lli = long long int;
ll MM = 1000000000;
ll mod = MM + 7;
#define INF (ll)1e18

ll arr[] = {
    2, 4, 8, 16, 32, 64, 128, 256, 512,
    1024, 2048, 4096, 8192, 16384,
    32768, 65536, 131072, 262144,
    524288, 1048576, 2097152, 4194304,
    8388608, 16777216, 33554432,
    67108864, 134217728, 268435456,
    536870912, 1073741824,
    2147483648, 4294967296
};
signed main(){
    ll n; cin >> n;
    ll a[200001];
    vector<ll> b(n), c(n), d(n), e(n);
    int cnt = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        if(a[i]%2 == 0) b.push_back(a[i]);
        else c.push_back(a[i]);
    }
    for(ll i = 0; i < b.size(); i++){
        for(ll j = 0; j != i && j < b.size(); j++){
            d.push_back(b[i] + b[j]);
        }
    }
    for(ll i = 0; i < c.size(); i++){
        for(ll j = 0; j != i && j < c.size(); j++){
        e.push_back(c[i] + c[j]);
        }
    }
    for(ll i = 0; i < d.size(); i++){
        if(d[i] == arr) cnt++;
    } for(ll i = 0; i < e.size(); i++){
        if(d[i] == arr) cnt++;
    }
    cout << cnt/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   45 |         if(d[i] == arr) cnt++;
a.cc:47:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   47 |         if(d[i] == arr) cnt++;
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <cstdint>
#include <string.h>
#include <queue>

using namespace std;


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

//    int tail = S.find_last_of('W');
//    if (tail == S.npos) cout << 0 << endl;

    int count = 0;
    for (auto i = tail; 0 <= i; --i) {
        if (S[i] == 'W') continue;
        count += tail - i;
        tail--;
    }
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'tail' was not declared in this scope; did you mean 'tanl'?
   24 |     for (auto i = tail; 0 <= i; --i) {
      |                   ^~~~
      |                   tanl
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> A;

  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A.push_back(a);
  }
  
  sort(A.begin(), A.end(), greater<int>());

  int res = 0;
  while (A.size() != 0) {
    for (int i = 1; i <= 32; i++) {
      int n = 1 << i - A[0];
      vector<int>::iterator iter = A.find(n);
      if (iter != A.end()) {
	res ++;
	A.erase(A.begin() + *iter);
	break;
      }
    }
    A.erase(A.begin());
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |   sort(A.begin(), A.end(), greater<int>());
      |   ^~~~
      |   short
a.cc:23:38: error: 'class std::vector<int>' has no member named 'find'
   23 |       vector<int>::iterator iter = A.find(n);
      |                                      ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
 
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define SUM(vec) accumulate((vec).begin(), (vec).end(), 0)  // 0 は初期値
typedef long long ll;
typedef unsigned long ul;
 
vector<ll> findChar(string& str, char pattern) {
    size_t len = str.length();
    vector<ll> vec;
    REP(i, len) {
        if (str[i] == pattern) {
            vec.push_back(i);
        }
    }
    return vec;
}
 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    // input
    string S;
    cin >> S;
    
    // calculation
    if ((int)S.find('W') != -1 && (int)S.find('B') != -1) {
        vector<ll> w_idx = findChar(S, 'W'), vec_Bnum(0);
        ll left = w_idx.front() - 0;  // 左端のBの数
        vec_Bnum.push_back(left);
        
        size_t len = w_idx.size();
        for (int i = 1; i < len; ++i) {
            vec_Bnum.push_back(w_idx[i] - w_idx[i-1] - 1);
        }
        
        partial_sum(vec_Bnum.begin(), vec_Bnum.end(), vec_Bnum.begin());
        if (vec_Bnum.size() == 0) {
            cout << 0 << "\n";
        } else {
            cout << SUM(vec_Bnum) << "\n";
        }
    } else {
        cout << 0 << "\n";
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'partial_sum' was not declared in this scope
   42 |         partial_sum(vec_Bnum.begin(), vec_Bnum.end(), vec_Bnum.begin());
      |         ^~~~~~~~~~~
a.cc:8:18: error: 'accumulate' was not declared in this scope
    8 | #define SUM(vec) accumulate((vec).begin(), (vec).end(), 0)  // 0 は初期値
      |                  ^~~~~~~~~~
a.cc:46:21: note: in expansion of macro 'SUM'
   46 |             cout << SUM(vec_Bnum) << "\n";
      |                     ^~~
Language: C++

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

#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define SUM(vec) accumulate(vec.begin(), vec.end(), 0)  // 0 は初期値
typedef long long ll;
typedef unsigned long ul;
 
vector<ll> findChar(string& str, char pattern) {
    size_t len = str.length();
    vector<ll> vec;
    REP(i, len) {
        if (str[i] == pattern) {
            vec.push_back(i);
        }
    }
    return vec;
}
 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    // input
    string S;
    cin >> S;
    
    // calculation
    if ((int)S.find('W') != -1 && (int)S.find('B') != -1) {
        vector<ll> w_idx = findChar(S, 'W'), vec_Bnum(0);
        ll left = w_idx.front() - 0;  // 左端のBの数
        vec_Bnum.push_back(left);
        
        size_t len = w_idx.size();
        for (int i = 1; i < len; ++i) {
            vec_Bnum.push_back(w_idx[i] - w_idx[i-1] - 1);
        }
        
        partial_sum(vec_Bnum.begin(), vec_Bnum.end(), vec_Bnum.begin());
        if (vec_Bnum.size() == 0) {
            cout << 0 << "\n";
        } else {
            cout << SUM(vec_Bnum) << "\n";
        }
    } else {
        cout << 0 << "\n";
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'partial_sum' was not declared in this scope
   42 |         partial_sum(vec_Bnum.begin(), vec_Bnum.end(), vec_Bnum.begin());
      |         ^~~~~~~~~~~
a.cc:8:18: error: 'accumulate' was not declared in this scope
    8 | #define SUM(vec) accumulate(vec.begin(), vec.end(), 0)  // 0 は初期値
      |                  ^~~~~~~~~~
a.cc:46:21: note: in expansion of macro 'SUM'
   46 |             cout << SUM(vec_Bnum) << "\n";
      |                     ^~~
Language: C++

#include <cstdio>
#include <iostream>
#include <iomanip>
#include<string>
#include<algorithm>
using namespace std;
#define ll long long
#define int ll
void main()
{
	string s;
	cin >> s;
	int ans = 0, cnt = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'B') { cnt++; }
		else { ans += cnt; }
		}
cout << ans << endl;
}

Compiler output:
a.cc:9:1: error: '::main' must return 'int'
    9 | void main()
      | ^~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <iomanip>
#include<string>
#include<algorithm>
using namespace std;
#define int long long
int main()
{
	string s;
	cin >> s;
	int ans = 0, cnt = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'B') { cnt++; }
		else { ans += cnt; }
		}
cout << ans << endl;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

typedef long long ll;

#define FOR(i, s, e)   for(int i = (s); i < (e); i++)
#define FOR64(i, s, e) for(ll  i = (s); i < (e); i++)
#define ALL(x)         (x).begin(), (x).end()
#define SORT(v)        sort((v).begin(), (v).end())
#define pb(a)          push_back(a)
#define INF            999999999

int main()
{
	char S[200004];

	scanf("%s", S);

	int N = strlen(S);

	// 置換回数
	ll count = 0;

	// 直前のBの連続回数
	int Bs = 0;

	FOR(i, 0, N){
		if(S[i] == 'B'){
			Bs++;
		}
		else{ // 'W'
			count += Bs;
		}
	}

	printf("%I64d\n", count);

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'strlen' was not declared in this scope
   21 |         int N = strlen(S);
      |                 ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();

        long result = 0;
        long whiteCount = 0;
        for (int i = 0; i < s.length(); ++i) {
            char ch = s.charAt(i)
            if (ch == 'W') {
                result += i - whiteCount;
                whiteCount++;
            }
        }
        System.out.println(result);
    }
}


Compiler output:
Main.java:11: error: ';' expected
            char ch = s.charAt(i)
                                 ^
1 error
Language: C++

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

int main() {
    string s ;
	cin >> s;
	int N = s.size();
	int a=0;
	int b=0;
	for(int i=0;i<N;i++){
	    if(s[i]=="W"){
			a++;
			b+=i;
		}
	}
    cout << b-a*(a-1)/2<<endl;
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |             if(s[i]=="W"){
Language: C++

#include<bits/stdc++.h>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: expected unqualified-id before 'long'
    7 |         long long ans = 0, long long = 0;
      |                            ^~~~
a.cc:9:38: error: no post-increment operator for type
    9 |                 if(s[i] == 'B') count++;
      |                                      ^~
a.cc:10:29: error: overloaded function with no contextual type information
   10 |                 else ans += count;
      |                             ^~~~~
Language: C++

#include<string>
using namespace std;

void one() {
	string input;

	cin >> input;
	long counter = 0;

	while (true)
	{
		int i;
		for (i = 0; i < input.length()/2; i++)
		{
			if (input[i] == 'B'&&input[i+1] == 'W') {
				counter++;
				input[i] = 'W';
				input[i+1] = 'B';
				break;
			}
			else if (input[input.length() - 2 - i] == 'B'&&input[input.length() - 1 - i] == 'W') {
				counter++;
				input[input.length() - 2 - i] = 'W';
				input[input.length() - 1 - i] = 'B';
				break;
			}
		}
		if (i == input.length() / 2)break;
	}
	cout << counter << endl;

}


int main() {
	one();
	//Sleep(1000);
	return 0;
}

Compiler output:
a.cc: In function 'void one()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> input;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:30:9: error: 'cout' was not declared in this scope
   30 |         cout << counter << endl;
      |         ^~~~
a.cc:30:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:28: error: 'endl' was not declared in this scope
   30 |         cout << counter << endl;
      |                            ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<string>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include<string>
#include<windows.h>
using namespace std;

void one() {
	string input;

	cin >> input;
	long counter = 0;

	while (true)
	{
		int i;
		for (i = 0; i < input.length()/2; i++)
		{
			if (input[i] == 'B'&&input[i+1] == 'W') {
				counter++;
				input[i] = 'W';
				input[i+1] = 'B';
				break;
			}
			else if (input[input.length() - 2 - i] == 'B'&&input[input.length() - 1 - i] == 'W') {
				counter++;
				input[input.length() - 2 - i] = 'W';
				input[input.length() - 1 - i] = 'B';
				break;
			}
		}
		if (i == input.length() / 2)break;
	}
	cout << counter << endl;

}


int main() {
	one();
	//Sleep(1000);
	return 0;
}

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

#include <iostream>
using namespace std;
typedef long long LL; 
int main()
{
	string s;
	cin>>s;
	LL n=s.length(),,sum=0;
	if(n==1)sum=0;
	else{
		LL pre=0;
		for(LL i=0;i<n;i++){
			if(s[i]=='B')pre++;
			else sum+=pre;
		}
	}
	cout<<sum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected unqualified-id before ',' token
    8 |         LL n=s.length(),,sum=0;
      |                         ^
Language: C

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

#define BUF_SIZE 200010
unsigned long long ans = 0;
unsigned long long count = 0;
char s[BUF_SIZE];
char *r;
int i;

int main(void){
    fgets(s, BUF_SIZE, stdin);
    for(i=0; i<BUF_SIZE; i++) {
        if( s[i] == '\n' || s[i] == '\0') {
            break;
        }
        if( s[i] == 'B') {
            count++;
        } else {
            ans += count
        }
    }
    printf("%llu",ans);
}


Compiler output:
main.c: In function 'main':
main.c:21:25: error: expected ';' before '}' token
   21 |             ans += count
      |                         ^
      |                         ;
   22 |         }
      |         ~
Language: C++

#include <stdio.h>
#include <string.h>
int main(){
  char str[200001],num[200001];
  int i,j=0,k,total=0;
  for(i=0;i<200001;i++){
      scanf("%c",&str[i]);
      if(str[i] == 'W'){
          num[j] = i;
          total += num[i] -j
          j++;
      }
  }
   printf("%d",total);
   return 0;
  }




Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: expected ';' before 'j'
   10 |           total += num[i] -j
      |                             ^
      |                             ;
   11 |           j++;
      |           ~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define print(obj) cout << obj << endl
#define scan(obj) cin >> obj

typedef long long ll;

using namespace std;

int main(void){
    //string s;
    //cin >> s;
    char s;
    ll bcount = 0, ans = 0,temp = 0, i = 0;
    while(s != '\0'){
        temp++;
        if(s[i] == 'B'){
            bcount++;
            ans -= i * 2;
        }
        i++;
    }
    ans += (2 * temp - 1 - bcount) * bcount;
    print((int)(ans / 2));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: invalid types 'char[ll {aka long long int}]' for array subscript
   21 |         if(s[i] == 'B'){
      |             ^
Language: C++

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

int main()
{
  string S;
  vector<int> B ={};
  int sum = 0;
  int cur;
  cin >> S;
  int Wstart;
  int Bstart = S.find("B");
  
  while(1){
    
  Wstart = S.find("W", Bstart);
  if(Wstart == -1) break;
  B.push_back(Wstart - Bstart);
  Bstart = S.find("B", Wstart);
  if(Bstart == -1) break;
  for(int l = 0; l < B.size ;l++){
      cur += B[l];
    }
  sum += cur*(Bstart - Wstart);
  }
  
  cout << sum << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   23 |   for(int l = 0; l < B.size ;l++){
      |                      ~~^~~~
      |                            ()
Language: Java

import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner stdin = new Scanner( System.in);
		String  x;
		long i=0,j=0;
		x =stdin.next();
		for(long k=1;k<=x.length();k++){
			String xx=x.substring(k-1,k);
			if(xx.equals("W")) {j=j+i;
			}else{i++;
			}
			
		}
		System.out.print(j);
	}
}


Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from long to int
			String xx=x.substring(k-1,k);
			                       ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C

 #include <stdio.h>
 
int o=0;
int main(void){
    
    char a[200005];
    int sum=0,b[200005];
    
    for(int i=0;i<=200005;i++){
        gets("%s",&a[i]);
    }
    
    
    for(int i=0;i<=200005;i++){
        if(a[i] == 'W'){
            b[o]=i;
            o++;
        }
    }
    for(int i=0;i<=o;i++){
            sum += b[i]-i;
        }
    puts("%d\n",sum+o);
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets("%s",&a[i]);
      |         ^~~~
      |         fgets
main.c:23:5: error: too many arguments to function 'puts'
   23 |     puts("%d\n",sum+o);
      |     ^~~~
In file included from main.c:1:
/usr/include/stdio.h:714:12: note: declared here
  714 | extern int puts (const char *__s);
      |            ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
char a[100000000];
long long n,k=0;
void fun(char a[])
{
	int i;
	for(i=0;i<strlen(a);i++)
	{
		if(a[i]=='B'&&a[i+1]=='W')
		{
			a[i]='W';
			a[i+1]='B';
			k++;
		}
	}
	return;
}
int main()
{
	long long m,i,j;
	gets(a);
	n=strlen(a);
	for(i=0;i<n;i++)
	{
		if(a[i]=='B'&&a[i+1]=='W')
		{
			a[i]='W';
			a[i+1]='B';
			k++;
			fun(a);
		}
	}
	printf("%lld",k);
	return 0;
 } 

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

#include<bits/stdc++.h>
using namespace std;
char a[10000];
int n,k=0;
void fun(char a[])
{
	int i;
	for(i=0;i<strlen(a);i++)
	{
		if(a[i]=='B'&&a[i+1]=='W')
		{
			a[i]='W';
			a[i+1]='B';
			k++;
		}
	}
	return;
}
int main()
{
	int m,i,j;
	gets(a);
	n=strlen(a);
	for(i=0;i<n;i++)
	{
		if(a[i]=='B'&&a[i+1]=='W')
		{
			a[i]='W';
			a[i+1]='B';
			k++;
			fun(a);
		}
	}
	printf("%d",k);
	return 0;
 } 

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

#include<iostream>
using namespace std;
int main(){
    long long int num[200000],max=0,ans=0,x=1;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>num[i];
        if(num[i]>max){
            max=num[i];
        }
    }
    max=max*2;
    while(x*2<=max){
        x*=2;
    }
    for(;x>=2;x/=2){
        for(int i=0;i<n-1;i++){
            for(int k=i+1;k<n;k++){
                if(num[i]+num[k]==x){
                    ans++;
                    num[i]=0.5;
                    num[k]=0.5;
                }
            }
        }
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'n' was not declared in this scope
    5 |     cin>>n;
      |          ^
Language: C

#include <stdio.h>

int main(void)
{
    char S[200001];
    scanf_s("%s",S, 200001);
    int i;
    
    unsigned int sum=0;
    int bnum=0;
    
    for(i=0; S[i]!='\0'; i++){
        if(S[i] == 'B'){
            bnum++;
        }
        else{
            sum += bnum;
        }
    }
    printf("%d\n",sum);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |     scanf_s("%s",S, 200001);
      |     ^~~~~~~
      |     scanf
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define max(a,b) (a<b?b:a)
#define abs(x) (x<0?(-x):x)
#define F(i,L,R) for (int i = L; i < R; i++)
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define RF(i,L,R) for (int i = L; i > R; i--)
#define RFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a)
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define VgetI(n) int (n); scanf("%d",&(n))
#define VgetII(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define ll long long
#define INF 1000000000000000005
#define nINF -2000000000
#define MOD 1e9+7
#define PI 3.1415926535897932384626
int main(){
	char in[200005];
	while(~scanf("%s",in)){
		int l=strlen(in)
                ll ans=0;
		ll dp[l+5];
		if(in[0]=='B') dp[0]=1;
		else dp[0]=0;
		F(i,1,l){
			if(in[i]=='B') dp[i]=dp[i-1]+1;
			else{
				dp[i]=dp[i-1];
				ans+=dp[i];
			}
		}
		printf("%lld\n",ans);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ',' or ';' before 'long'
   15 | #define ll long long
      |            ^~~~
a.cc:24:17: note: in expansion of macro 'll'
   24 |                 ll ans=0;
      |                 ^~
a.cc:32:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |                                 ans+=dp[i];
      |                                 ^~~
      |                                 abs
a.cc:35:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |                 printf("%lld\n",ans);
      |                                 ^~~
      |                                 abs
Language: C


#include <stdio.h>

int main(void)
{
    char S[200001];
    scanf("%s",S);
    int i;
    
    unsigned int sum=0;
    int bnum=0;
    
    for(i=0; S[i]!='\0'; i++){
        if(S[i] == 'B'){
            bnum++;
        }
        else if{
            sum += bnum;
        }
    }
    printf("%d\n",sum);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:16: error: expected '(' before '{' token
   17 |         else if{
      |                ^
      |                (
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int N = S.length();
        int BN = 0;
        char[] cArray = S.toCharArray();
        int ci = 0;
	ArrayList<Integer> a = new ArrayList<Integer>();

	for(int i = 0; i<cArray.length;i++) {
            if(cArray[i]=='B') {
                BN++;
		a.add(i);
            }
        }
        int fb, goalIndex;
        int cnt = 0;
        String sub = S.substring(0);
	int bn = BN;
        int index = 0;
        while(index < BN) {
	    fb = a.get(index);
            goalIndex = N-(bn--)-fb;
	    cnt = cnt + goalIndex;
            index++;
        }
	System.out.println(cnt);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:9: error: cannot find symbol
	ArrayList<Integer> a = new ArrayList<Integer>();
	^
  symbol:   class ArrayList
  location: class Main
Main.java:9: error: cannot find symbol
	ArrayList<Integer> a = new ArrayList<Integer>();
	                           ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: C++

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

    int count = 0;
    for(int i = 0; i < s.size()*s.size(); i++){
        for(int j = 0; j < s.size()-1; j++){
            if(s[j] == 'B' && s[j+1] == 'W'){
                s[j] = 'W';
                s[j+1] = 'B';
                count++;
            }
        }
    }
    cout << count << 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:12: error: 's' was not declared in this scope
    3 |     cin >> s;
      |            ^
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   15 |     cout << count << endl;
      |     ^~~~
      |     count
a.cc:15:22: error: 'endl' was not declared in this scope
   15 |     cout << count << endl;
      |                      ^~~~
Language: C++

#include <stdio.h>
#define LIM 200000

int main(void){

    const char brack = '0';
    const char write = '1';
    int color = -1;
    int flag = 0;
    int count = 0;

    char input[LIM];
    scanf("%s", input);

    for(int i = 0; input[i] != \0;i++){
        if(input[i] == brack){
            flag = 1;
        }
        else if(flag == 1){
            if(input[i] == write){
            count++;
            }
        }
        else{
            flag = 0;
        }
    }

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

Compiler output:
a.cc:15:32: error: stray '\' in program
   15 |     for(int i = 0; input[i] != \0;i++){
      |                                ^
Language: C++

#include <stdio.h>
#define LIM 200000

int main(void){

    const char brack = '0';
    const char write = '1';
    int color = -1;
    int flag = 0;
    int count = 0;

    char input[LIM];
    scanf("%s",&input);

    for(int i = 0; input[i] != \0;i++){
        if(input[i] == brack){
            flag = 1;
        }
        else if(flag == 1){
            if(input[i] == write){
            count++;
            }
        }
        else{
            flag = 0;
        }
    }

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

Compiler output:
a.cc:15:32: error: stray '\' in program
   15 |     for(int i = 0; input[i] != \0;i++){
      |                                ^
Language: C++

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

typedef long long LL
int main()
{
    string S;
    cin >> S;
    LL N = S.length();
    LL counter = 0, result = 0;
    for (int i = 0; i < N; ++i)
    {
        if (S[i] == 'B')
            counter++;
        else if (S[i] == 'W')
            result += counter;
    }

    cout << result;
    return 0;
}


Compiler output:
a.cc:6:1: error: expected initializer before 'int'
    6 | int main()
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
char a[200001],tmp;
int len,cntB,cntW;
int check()
{
	int i=0,cntb,cntw;
	for(i=0;i<len;i++)
		if(a[i]=='B')
			if(i<cntW)
				return 0;
			else
			{
			//	printf("%c ",a[0]);
				return 1;
			}
//	printf("%d ",i);
	return 1;
}
int main()
{
	int i,cnt;
	gets(a);
	len=strlen(a);
	cnt=cntB=cntW=0; 		
	for(i=0;i<len;i++)
		if(a[i]=='W')
			cntW++;
		else	
			cntB++;
	for(cnt=0;;cnt++)
	{
		if(check()==1)
		{
			printf("%d",cnt);
			return 0;
		}
		for(i=0;i<len-1;i++)
			if(a[i]=='B'&&a[i+1]=='W')
			{
			//	printf("%d ",i);
				tmp=a[i];
				a[i]=a[i+1];
				a[i+1]=tmp;
			//	printf("%c %c %c\n",a[0],a[1],a[2]);
				break;
			}
	}
	return 0;
}

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

import re
S = input()
res = 0
it = re.finditer('W+', S)
for match in it:
    # print(match.group())
    res += S[:match.start()].count('B') * len(match.group())
print(res)


Compiler output:
a.cc:4:18: warning: multi-character character constant [-Wmultichar]
    4 | it = re.finditer('W+', S)
      |                  ^~~~
a.cc:6:7: error: invalid preprocessing directive #print
    6 |     # print(match.group())
      |       ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import re
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main () {
  int a[200001]
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i ++) {
    if (s[i] = 'B') a[i] = 0;
    if (s[i] = 'W') a[i] = 1;
  }
  a[n] = 0;
  int count = 0;
  while (true) {
    bool did = true;
    int i = 0;
    while (i < n) {
      if (!a[i] && a[i + 1]) {
        a[i] = 1;
        a[i + 1] = 0;
        count += 1;
        i += 2;
        did = false;
      }else i += 1;
    }
    if (did) break;
  }
  cout << count << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'string'
    6 |   string s;
      |   ^~~~~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:10:21: error: 'a' was not declared in this scope
   10 |     if (s[i] = 'B') a[i] = 0;
      |                     ^
a.cc:11:21: error: 'a' was not declared in this scope
   11 |     if (s[i] = 'W') a[i] = 1;
      |                     ^
a.cc:13:3: error: 'a' was not declared in this scope
   13 |   a[n] = 0;
      |   ^
a.cc:29:25: error: expected '}' at end of input
   29 |   cout << count << endl;
      |                         ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

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

int main(){
 int a=0,cnt=0;
 string s;
 cin >> s;
for(int i=0;i<s.size();i++){
 if(s[i]=='B'){
   cnt++;
}
else if(cnt>0){cnt=0;a++;}
}
    cout << a*2 << endl;
    return 0;
}

Compiler output:
a.cc:14:1: error: extended character   is not valid in an identifier
   14 |     cout << a*2 << endl;
      | ^
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
   15 |     return 0;
      | ^
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc: In function 'int main()':
a.cc:14:1: error: '\U000000a0\U000000a0\U000000a0' was not declared in this scope
   14 |     cout << a*2 << endl;
      | ^~~
a.cc:15:4: error: expected ';' before 'return'
   15 |     return 0;
      |    ^~~~~~~
      |    ;
Language: C++

#include <stdio.h>
#define moji 1000000 

char s[moji];
short i=0;

void cmoji(short l);

short main(){
    short l;
    short v=1;
    scanf("%s",&s);
    while(v==1){
        v=0;
        for(l=1;l<moji;l++){
            if(s[l]=='W'&&s[l-1]=='B') {
                 i++;
                 cmoji(l);
                 v=1;
            } 
        }
    }
    prshortf("%d",i);
    return 0;
}

void cmoji(short l){
    s[l]='B';
    s[l-1]='W';
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:23:5: error: 'prshortf' was not declared in this scope; did you mean 'short'?
   23 |     prshortf("%d",i);
      |     ^~~~~~~~
      |     short
Language: C++

#include<bits/stdc++.h>
using namespace std;
char c[200001];
int main()
{
	int sum=0,i,j,start=0,n;
	scanf("%s",c);
	n=strlen(c);
	start=n-2;
	for(i=1;i<n,&&start>0;i++)
	{
		for(j=start;j>=0;j--)
		{
			if(c[j]=='W'&&c[j-1]=='B')
			{
				c[j]='B';
				c[j-1]='W';
				sum++;
				if(j==start)
					start--;
			}
		}
	}
	printf("%d",sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: ordered comparison of pointer with integer zero ('void*' and 'int')
   10 |         for(i=1;i<n,&&start>0;i++)
      |                     ~~~~~~~^~
a.cc:10:23: error: label 'start' used but not defined
   10 |         for(i=1;i<n,&&start>0;i++)
      |                       ^~~~~
Language: C++

// author: hjy
// Problem:
#include<bits/stdc++.h>
//#pragma GCC optimize(2)
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define rep(i,n) for(register int i=0; i<(int)(n); ++i)
#define per(i,n) for(register int i=(int)(n)-1; i>=0; --i)
#define rep1(i,n) for(register int i=1; i<=(int)(n); ++i)
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<"="<<x<<'\n'
template<typename T1, typename T2>
inline bool umin(T1 &a, const T2 &b) { return a > b ? a = b, true : false; }
template<typename T1, typename T2>
inline bool umax(T1 &a, const T2 &b) { return a < b ? a = b, true : false; }
inline int read() {
	int x=0,ng=0;
	char ch=getchar();
	while(ch<'0'||ch>'9') { if(ch=='-') ng=1; ch=getchar(); }
	while(ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return ng?-x:x;
}
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
const int seed=20040305;

string s;
int n;

int main()
{
	cin>>s;
	n=s.size();
	int cnt=0;
	ll res=0;
	for(int i=n-1;i>=0;i--)
	{
		if(s[i]=='W') continue;
		int tmp=(n-1)-BBWi;
		tmp-=cnt;
		res+=tmp;
		cnt++;
	}
	cout<<res;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:31: error: 'BBWi' was not declared in this scope
   45 |                 int tmp=(n-1)-BBWi;
      |                               ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
int main(){
    string s;
    cin>>s;
    int l=s.size(),n=0;
    while(true){
        bool check=false;
        for(int i=0;i<l-1;i++){
            string x=s.substr(i,2);
            if(x=="BW"){
                s[i]='W';
                s[i+1]='B';
                n++;
                check=true;
            }
        }
        if(check==false){
            cout<<n<<endl;
            return 0;
        }
    }
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(void)
{
    string S;
    cin >> S;
    int key = 0
    long long ans=0;
    for(int i = 0;i < S.size();i++){
        if(S[i] == 'W'){
            ans += i - key;
            key++;
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'long'
    9 |     long long ans=0;
      |     ^~~~
a.cc:12:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |             ans += i - key;
      |             ^~~
      |             abs
a.cc:16:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ci cin >>
#define co cout <<

string S;
int ans;
int i;
int answ = 0;
int main() {
	ci S;
	int len = S.size();
	
	for (int i = 0; answ == 0 && i == len;++i) {
		if (i == 0)answ = 0;
		if (S[i] == 'B' && S[i + 1] == 'W') {
			ans++;
			answ++;
			S[i + 1] = 'B';
		}
		if (i == ren)i = 0;
	}
	co ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:26: error: 'ren' was not declared in this scope; did you mean 'len'?
   27 |                 if (i == ren)i = 0;
      |                          ^~~
      |                          len
Language: C++

/// sultanov_ 

#include <bits/stdc++.h>
#include <windows.h>

#define file_name ""

#define pb push_back
#define F first
#define S second
#define size(x) (int)x.size()
#define mkp make_pair
#define show(x) cout << (#x) << ": " << x << ", "
#define showln(x) cout << (#x) << ": " << x << "\n"

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
template<typename T> using graph = vector<vector<T>>;
  
const ll INF = (ll)1e9 + 6ll;

const int DX[] = {+1, -1, 0, 0, +1, -1, -1, +1};                                                
const int DY[] = {0, 0, +1, -1, +1, -1, +1, -1};    

void freeopen() {
#ifdef LOCAL
	freopen(file_name".in", "r", stdin);
	freopen(file_name".out", "w", stdout);
#endif	
}

void cheetah() {
	ios_base::sync_with_stdio(0); 
	cin.tie(nullptr);
	cout.tie(nullptr);	
}

int main() {
	freeopen();
	cheetah();             
	string s;
	cin >> s;
	ll ans = 1;
	for (int i = 0; i < size(s) - 1; i++)
		if (s[i] != s[i + 1])	    	
			ans++;
	cout << ans;
	return 0; 
}   

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

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	string s;
	cin >> s;
    
	int sum = 0;
	int b_cnt = 0;
    int N = s.length()
	for(int i = 0; i < N; i++){
	    if(s[i] == 'B'){
	        b_cnt++;
	    }
	    else if(s[i] == 'W'){
	        sum += b_cnt;
	    }
	}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: expected ',' or ';' before 'for'
   12 |         for(int i = 0; i < N; i++){
      |         ^~~
a.cc:12:24: error: 'i' was not declared in this scope
   12 |         for(int i = 0; i < N; i++){
      |                        ^
a.cc:21:25: error: expected ';' before 'return'
   21 |         printf("%d",sum)
      |                         ^
      |                         ;
   22 |         return 0;
      |         ~~~~~~
Language: Java

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

        int black=0;
        int white=0;
        int count=0;
        String str = "B";
        char c = str.charAt(0);

        for(int i=str.length()-1; i>=0; i--){
            if(str.charAt(i) == c){
                count += white;
            }else{
                white++;
            }
        }

        System.out.println(count);

 
    }



}

Compiler output:
Main.java:11: error: variable str is already defined in method main(String[])
        String str = "B";
               ^
1 error
Language: C++

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

int main(){
    int a=0,cnt=0;
string s;
    cin >> s;
for(int i=0;i<s.size();i++){
 if(s[i]=='B'){
   cnt++;
}
else if(cnt>0){cnt=0;a++;}
}
    cout << a*2 << endl;
    return 0;
}

Compiler output:
a.cc:5:1: error: extended character   is not valid in an identifier
    5 |     int a=0,cnt=0;
      | ^
a.cc:5:1: error: extended character   is not valid in an identifier
a.cc:5:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
    7 |     cin >> s;
      | ^
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
   14 |     cout << a*2 << endl;
      | ^
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
   15 |     return 0;
      | ^
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc: In function 'int main()':
a.cc:5:1: error: '\U000000a0\U000000a0\U000000a0' was not declared in this scope
    5 |     int a=0,cnt=0;
      | ^~~
a.cc:7:4: error: expected ';' before 'cin'
    7 |     cin >> s;
      |    ^~~~
      |    ;
a.cc:10:4: error: 'cnt' was not declared in this scope; did you mean 'int'?
   10 |    cnt++;
      |    ^~~
      |    int
a.cc:12:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   12 | else if(cnt>0){cnt=0;a++;}
      |         ^~~
      |         int
a.cc:12:22: error: 'a' was not declared in this scope
   12 | else if(cnt>0){cnt=0;a++;}
      |                      ^
a.cc:14:4: error: expected ';' before 'cout'
   14 |     cout << a*2 << endl;
      |    ^~~~~
      |    ;
a.cc:15:4: error: expected ';' before 'return'
   15 |     return 0;
      |    ^~~~~~~
      |    ;
Language: C

#include<stdio.h>
int main(void){
    int stop,k=0;
    char s[100000];
    scanf("%s",s);
    stop=1;
    while(stop==1){
        stop=0;
    for(int i=0;i<sizeof(s);i++){
        ;
        if (s[i]=='B'&&s[i+1]=='W') {
            s[i]='W';
            s[i+1]='B';
            k=k+1;
            stop=1;
        };
        
    };
    };
    printf("%d",k);
    

Compiler output:
main.c: In function 'main':
main.c:20:5: error: expected declaration or statement at end of input
   20 |     printf("%d",k);
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define print(obj) cout << obj << endl
#define scan(obj) cin >> obj

typedef long long ll;

using namespace std;

int main(void){
    string s;
    cin >> s;
    vector<int> test;
    int bcount = 0, ans = 0;
    rep(i, s.length()){
        if(s[i] == 'B'){
            bcount++;
            test.insert(test.begin(), i);
        }
    }
    int a = 0, ans = 0;
    rep(i, test.size()){
        ans += test.size() - test[i] - a;
        a++;
    }
    print(a);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: redeclaration of 'int ans'
   25 |     int a = 0, ans = 0;
      |                ^~~
a.cc:18:21: note: 'int ans' previously declared here
   18 |     int bcount = 0, ans = 0;
      |                     ^~~
Language: Java

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

        int black=0;
        int white=0;
        int count=0;

        for(int i=str.length()-1; i>=0; i--){
            if(str.charAt(i).equals("B")){
                count += white;
            }else{
                white++;
            }
        }

        System.out.println(count);

 
    }



}

Compiler output:
Main.java:13: error: char cannot be dereferenced
            if(str.charAt(i).equals("B")){
                            ^
1 error
Language: Java

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

        int black=0;
        int white=0;
        int count=0;

        for(int i=str.length()-1; i>=0; i==){
            if(str.charAt(i).equals("B")){
                count += white;
            }else{
                white++;
            }
        }

        System.out.println(count);

 
    }



}

Compiler output:
Main.java:12: error: illegal start of expression
        for(int i=str.length()-1; i>=0; i==){
                                           ^
Main.java:12: error: not a statement
        for(int i=str.length()-1; i>=0; i==){
                                         ^
2 errors
Language: C++

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ci cin >>
#define co cout <<

string S;
int ans;
int i;

int main() {
	ci S;
	int len = S.size();
	
		REP(i, len) {
			if (S[i] == 'B' && S[i + 1] == 'W') {
				ans++;
				S[i + 1] = 'B';
			}
			if (S[i] == 'B' && S[i + 1] == 'B' ) {
				if(S[i + 2] == 'B' || S[i + 2] == 'W')ans++;
		}
	co ans;
	return 0;
}

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

S = input()
res = 0
count_b = 0
for i, s in enumerate(S[::-1]):
    
    if s == "B":
        res += i - count_b
        count_b += 1
print(res)


Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^