Language: C++

#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
typedef unsigned long ul;
typedef pair<ul, ul> P;



int main()
{

    string S;
    cin >> S;
    uint64_t count = 0;

    REP(i, S.size())
    {
        
        if (S[i] == 'B')
        {
            count += 1;
        }
    }
    uint16_t w = S.size() - count;
    uint16_t n = 0;
    uint16_t l = 0;
    REP(i, S.size())
    {
        
        if (S[i] == 'B')
        {
            n += w - i + l;
            l++;
        }
    }
    cout << n << endl;
    return 0;
}
#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
typedef unsigned long ul;
typedef pair<ul, ul> P;



int main()
{

    string S;
    cin >> S;
    uint64_t count = 0;

    REP(i, S.size())
    {
        
        if (S[i] == 'B')
        {
            count += 1;
        }
    }
    uint16_t w = S.size() - count;
    uint16_t n = 0;
    uint16_t l = 0;
    REP(i, S.size())
    {
        
        if (S[i] == 'B')
        {
            n += w - i + l;
            l++;
        }
    }
    cout << n << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'uint64_t' was not declared in this scope
   21 |     uint64_t count = 0;
      |     ^~~~~~~~
a.cc:9:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    8 | #include <utility>
  +++ |+#include <cstdint>
    9 | using namespace std;
a.cc:28:22: error: overloaded function with no contextual type information
   28 |             count += 1;
      |                      ^
a.cc:31:5: error: 'uint16_t' was not declared in this scope
   31 |     uint16_t w = S.size() - count;
      |     ^~~~~~~~
a.cc:31:5: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:32:13: error: expected ';' before 'n'
   32 |     uint16_t n = 0;
      |             ^~
      |             ;
a.cc:33:13: error: expected ';' before 'l'
   33 |     uint16_t l = 0;
      |             ^~
      |             ;
a.cc:39:13: error: 'n' was not declared in this scope
   39 |             n += w - i + l;
      |             ^
a.cc:39:18: error: 'w' was not declared in this scope
   39 |             n += w - i + l;
      |                  ^
a.cc:39:26: error: 'l' was not declared in this scope
   39 |             n += w - i + l;
      |                          ^
a.cc:43:13: error: 'n' was not declared in this scope
   43 |     cout << n << endl;
      |             ^
a.cc: At global scope:
a.cc:61:5: error: redefinition of 'int main()'
   61 | int main()
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:66:5: error: 'uint64_t' was not declared in this scope
   66 |     uint64_t count = 0;
      |     ^~~~~~~~
a.cc:66:5: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:73:22: error: overloaded function with no contextual type information
   73 |             count += 1;
      |                      ^
a.cc:76:5: error: 'uint16_t' was not declared in this scope
   76 |     uint16_t w = S.size() - count;
      |     ^~~~~~~~
a.cc:76:5: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:77:13: error: expected ';' before 'n'
   77 |     uint16_t n = 0;
      |             ^~
      |             ;
a.cc:78:13: error: expected ';' before 'l'
   78 |     uint16_t l = 0;
      |             ^~
      |             ;
a.cc:84:13: error: 'n' was not declared in this scope
   84 |             n += w - i + l;
      |             ^
a.cc:84:18: error: 'w' was not declared in this scope
   84 |             n += w - i + l;
      |                  ^
a.cc:84:26: error: 'l' was not declared in this scope
   84 |             n += w - i + l;
      |                          ^
a.cc:88:13: error: 'n' was not declared in this scope
   88 |     cout << n << endl;
      |             ^