Language: C++

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
 
int xmove[4001];
int ymove[4001];
int xmove_len=0, ymove_len=0;
 
char S[8001];
int goalx,goaly;
 
char dp[4001][8001];
 
int abs(int a){ return (a < 0)? -a : a;}

int compare_disascending(const void * a, const vioid * b){
    return *(int*)b - *(int*)a;
}
char possible(int goal, int * move, int move_len){
    if(move_len == 0){
        if(goal == 0) return 1;
        else          return 0;
    }
    qsort(move,move_len,sizeof(int),compare_disascending);
    for(int i = 0; i < move_len; i++){
        if(goal > 0) goal -= move[i];
        else         goal += move[i];
    }
    if(goal == 0) return 1;
    else          return 0;
    /*
    int sum = 0;
    for(int i = 0; i < move_len ; i++) sum += move[i];
      
    if(sum < goal || (sum-goal) % 2 == 1) return 0;
 
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    dp[0][move[0]]=1;
    for(int i = 1; i < move_len; i++){
        for(int j = 0; j <= (sum-goal)/2 ; j++){
            dp[i][j] |= dp[i-1][j];
            if(j-move[i] >= 0) dp[i][j] |= dp[i-1][j-move[i]];    
        }
    }
    return dp[move_len-1][(sum-goal)/2];
    */
}
 
int main(void){
    scanf("%s",S);
    scanf("%d %d",&goalx,&goaly);
 
    int xmove_ind = 0, ymove_ind = 0;
    char dir_x = 1;
    int count = 0;
    for(int i = 0; i <= strlen(S); i++){
        if(i == strlen(S) || S[i] == 'T' ){
            if(dir_x) xmove[xmove_ind++] = count;
            else      ymove[ymove_ind++] = count;
            
            dir_x = !dir_x;
            count = 0;
        }else{
            count++;
        }
    }
    xmove_len = xmove_ind;
    ymove_len = ymove_ind;
 
    if(possible(abs(goaly),ymove,ymove_len)){
        if(xmove_len==1){
            if(goalx == xmove[0]) puts("Yes");
            else                  puts("No");
        }else{
            if(possible(abs(goalx-xmove[0]), &(xmove[1]), xmove_len-1)) puts("Yes");
            else                                                        puts("No");
        }
    }else{
        puts("No");
    }
    
    return 0;
}

Compiler output:
a.cc:16:48: error: 'vioid' does not name a type; did you mean 'void'?
   16 | int compare_disascending(const void * a, const vioid * b){
      |                                                ^~~~~
      |                                                void
a.cc: In function 'char possible(int, int*, int)':
a.cc:24:37: error: invalid conversion from 'int (*)(const void*, const int*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
   24 |     qsort(move,move_len,sizeof(int),compare_disascending);
      |                                     ^~~~~~~~~~~~~~~~~~~~
      |                                     |
      |                                     int (*)(const void*, const int*)
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/stdlib.h:36,
                 from a.cc:3:
/usr/include/stdlib.h:971:34: note:   initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~