Language: Java

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

char s[252521];

int main(){
  scanf("%s",s);
  int n = strlen(s);
  ll ans = 0;
  int tmp = 0;
  REP(i,n){
    if(s[i]=='B')tmp++;
    else{
      ans += tmp;
    }
  }
  printf("%lld\n",ans);
  return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:5: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:6: error: class, interface, enum, or record expected
typedef vector<int> vi;
^
Main.java:7: error: class, interface, enum, or record expected
typedef vector<ll> vl;
^
Main.java:8: error: class, interface, enum, or record expected
typedef pair<int,int> pii;
^
Main.java:9: error: class, interface, enum, or record expected
typedef pair<ll,ll> pll;
^
Main.java:11: error: class, interface, enum, or record expected
typedef int _loop_int;
^
Main.java:12: error: illegal character: '#'
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
^
Main.java:12: error: class, interface, enum, or record expected
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
        ^
Main.java:12: error: class, interface, enum, or record expected
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
                                   ^
Main.java:12: error: class, interface, enum, or record expected
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
                                                    ^
Main.java:13: error: illegal character: '#'
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
^
Main.java:13: error: class, interface, enum, or record expected
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
                                                  ^
Main.java:13: error: class, interface, enum, or record expected
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
                                                                   ^
Main.java:14: error: illegal character: '#'
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)
^
Main.java:14: error: class, interface, enum, or record expected
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)
                                                     ^
Main.java:14: error: class, interface, enum, or record expected
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)
                                                                       ^
Main.java:16: error: illegal character: '#'
#define DEBUG(x) cout<<#x<<": "<<x<<endl
^
Main.java:16: error: illegal character: '#'
#define DEBUG(x) cout<<#x<<": "<<x<<endl
                       ^
Main.java:17: error: illegal character: '#'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
^
Main.java:17: error: illegal character: '#'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
                           ^
Main.java:17: error: class, interface, enum, or record expected
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
                                   ^
Main.java:17: error: class, interface, enum, or record expected
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
                                                                  ^
Main.java:18: error: illegal character: '#'
#define ALL(a) (a).begin(),(a).end()
^
Main.java:20: error: illegal character: '#'
#define CHMIN(a,b) a=min((a),(b))
^
Main.java:21: error: illegal character: '#'
#define CHMAX(a,b) a=max((a),(b))
^
Main.java:25: error: illegal character: '#'
#define FIX(a) ((a)%MOD+MOD)%MOD
^
Main.java:25: error: class, interface, enum, or record expected
#define FIX(a) ((a)%MOD+MOD)%MOD
        ^
Main.java:29: error: class, interface, enum, or record expected
const Real EPS = 1e-11;
^
Main.java:30: error: illegal character: '#'
#define EQ0(x) (abs(x)<EPS)
^
Main.java:30: error: class, interface, enum, or record expected
#define EQ0(x) (abs(x)<EPS)
        ^
Main.java:31: error: illegal character: '#'
#define EQ(a,b) (abs(a-b)<EPS)
^
Main.java:34: error: class, interface, enum, or record expected
char s[252521];
^
Main.java:36: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:41: error: ';' expected
  REP(i,n){
          ^
36 errors