Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((int)(a)<=(int)(i) && (int)(i)<(int)(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30);
const int INF = (1LL << 60);
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
template< typename T > istream &operator>>(istream &is, vector< T > &v) { for(T &in : v) is >> in; return is; }



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------

    // REがわからない、お手上げ
    
    string s;int x,y;
    cin>>s>>x>>y;
    s+="TT";
    int tcnt=0;
    int dist=0;
    int geta=8000;
    vec xx(0),yy(0); // x方向とy方向の移動で分ける
    int n=s.size();
    rep(i,n){
        if(s[i]=='T'){
            if(tcnt%2==0) xx.pb(dist);
            if(tcnt%2==1) yy.pb(dist);
            dist=0;
            tcnt++;
            continue;
        }
        dist++;
    }

    // for(auto xxx:xx) debug(xxx);
    // for(auto yyy:yy) debug(yyy);

    // int xdp[xx.size()+10][2*geta+10];
    vvec xdp((xx.size()+10),vec (2*geta+10));
    // int ydp[yy.size()+10][2*geta+10];
    // vvec ydp((yy.size()+10),vec (2*geta+10));
    // rep(i,xx.size()+10) rep(j,2*geta+10) xdp[i][j]=0;
    // rep(i,yy.size()+10) rep(j,2*geta+10) ydp[i][j]=0;

    // x方向のdp
    xdp[0][xx[0]+geta]=1;
    for(int i=1;i<xx.size();i++){
        int dist=xx[i];
        rep(j,2*geta+10){
            if(xdp[i-1][j]==1){
                if(range(j+dist,0,2*geta+10)) xdp[i][j+dist]=1;
                if(range(j-dist,0,2*geta+10)) xdp[i][j-dist]=1;
            }
        }
    }
    int xmemo=xdp[xx.size()-1][x+geta];
  
  	xdp.assign(yy.size()+10,2*geta+10);

    // y方向のdp
    xdp[0][geta+yy[0]]=1;
    xdp[0][geta-yy[0]]=1;
    for(int i=1;i<yy.size();i++){
        int dist=yy[i];
        rep(j,2*geta+10){
            if(xdp[i-1][j]==1){
                if(range(j+dist,0,2*geta+10)) xdp[i][j+dist]=1;
                if(range(j-dist,0,2*geta+10)) xdp[i][j-dist]=1;
            }
        }
    }

    if(xmemo==1&&xdp[yy.size()-1][y+geta]==1){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:91:19: error: no matching function for call to 'std::__debug::vector<std::__debug::vector<long long int> >::assign(std::__cxx1998::vector<long long int, std::allocator<long long int> >::size_type, long long int)'
   91 |         xdp.assign(yy.size()+10,2*geta+10);
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:76,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:2:
/usr/include/c++/14/debug/vector:282:9: note: candidate: 'template<class _InputIterator, class> void std::__debug::vector<_Tp, _Allocator>::assign(_InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _Tp = std::__debug::vector<long long int>; _Allocator = std::allocator<std::__debug::vector<long long int> >]'
  282 |         assign(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~
/usr/include/c++/14/debug/vector:282:9: note:   template argument deduction/substitution failed:
a.cc:91:19: note:   deduced conflicting types for parameter '_InputIterator' ('long unsigned int' and 'long long int')
   91 |         xdp.assign(yy.size()+10,2*geta+10);
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/debug/vector:303:7: note: candidate: 'void std::__debug::vector<_Tp, _Allocator>::assign(size_type, const _Tp&) [with _Tp = std::__debug::vector<long long int>; _Allocator = std::allocator<std::__debug::vector<long long int> >; size_type = long unsigned int]'
  303 |       assign(size_type __n, const _Tp& __u)
      |       ^~~~~~
/usr/include/c++/14/debug/vector:303:40: note:   no known conversion for argument 2 from 'long long int' to 'const std::__debug::vector<long long int>&'
  303 |       assign(size_type __n, const _Tp& __u)
      |                             ~~~~~~~~~~~^~~
/usr/include/c++/14/debug/vector:316:7: note: candidate: 'void std::__debug::vector<_Tp, _Allocator>::assign(std::initializer_list<_Tp>) [with _Tp = std::__debug::vector<long long int>; _Allocator = std::allocator<std::__debug::vector<long long int> >]'
  316 |       assign(initializer_list<value_type> __l)
      |       ^~~~~~
/usr/include/c++/14/debug/vector:316:7: note:   candidate expects 1 argument, 2 provided