Language: C++

#include<bits/stdc++.h>
using namespace std;
const int w=20003;
char s[10005];
int x,y,_x,len,p,sum,q,now=1;
bool ws[2][2][40009];
int main(void){
    register int i;
    scanf("%s%d%d",s+1,&x,&y),len=strlen(s+1),x+=w,y+=w;
    while(now<=len&&s[now]=='F')++now,++_x;
    ws[0][0][w+_x]=1,ws[1][0][w]=1;
    while(now<=len){
        ++now,sum=0,p^=1,q^=p;
        while(now<=len&&s[now]=='F')++sum,++now;
        for(int i=w-len;i<=w+len;++i)
            ws[p][q][i]=ws[p][q^1][i+sum]|ws[p][q^1][i-sum];
    }
    if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y])puts("Yes");
    else puts("No"); 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |     register int i;
      |                  ^
a.cc:11:5: error: reference to 'ws' is ambiguous
   11 |     ws[0][0][w+_x]=1,ws[1][0][w]=1;
      |     ^~
In file included from /usr/include/c++/14/istream:1109,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~
a.cc:11:22: error: reference to 'ws' is ambiguous
   11 |     ws[0][0][w+_x]=1,ws[1][0][w]=1;
      |                      ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~
a.cc:16:13: error: reference to 'ws' is ambiguous
   16 |             ws[p][q][i]=ws[p][q^1][i+sum]|ws[p][q^1][i-sum];
      |             ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~
a.cc:16:25: error: reference to 'ws' is ambiguous
   16 |             ws[p][q][i]=ws[p][q^1][i+sum]|ws[p][q^1][i-sum];
      |                         ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~
a.cc:16:43: error: reference to 'ws' is ambiguous
   16 |             ws[p][q][i]=ws[p][q^1][i+sum]|ws[p][q^1][i-sum];
      |                                           ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~
a.cc:18:14: error: reference to 'ws' is ambiguous
   18 |     if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y])puts("Yes");
      |              ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~
a.cc:18:29: error: reference to 'ws' is ambiguous
   18 |     if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y])puts("Yes");
      |                             ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~
a.cc:18:48: error: reference to 'ws' is ambiguous
   18 |     if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y])puts("Yes");
      |                                                ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~
a.cc:18:61: error: reference to 'ws' is ambiguous
   18 |     if(p==1&&ws[0][q^1][x]&&ws[1][q][y]||p==0&&ws[0][q][x]&&ws[1][q][y])puts("Yes");
      |                                                             ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:6:6: note:                 'bool ws [2][2][40009]'
    6 | bool ws[2][2][40009];
      |      ^~