Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main(){
    string s; cin >> s;
    int n = s.size();
    int x,y; cin >> x >> y;
    int s = 0;
    vector<int> vx(0), vy(0);

    bool side = true; //sideで横向き、!sideで縦向き 
    for(int i = 0; i < n; i++){
        if(s[i] == 'F'){
            s++;
        } else if(s[i] == 'T'){
            if(side){
                vx.push_back(s);
                side = false;
                s = 0;
            } else {
                vy.push_back(s);
                s = 0;
                side = true;
            }
        }
    }
    bool dpx[16001][4000];
    bool dpy[16001][4000];

    fill(dpx[0],dpx[16001],false);
    fill(dpy[0],dpy[16001],false);

    dpx[8000][0] = true; dpy[8000][0] = true;

    for(int i = 1; i < vx.size(); i++){
        for(int j = 0; j <= 16000; j++){
            bool b = false, b2 = false;
            if(j-vx[i-1]>=0) b = dpx[j-vx[i-1]][i-1];
            if(j+vx[i-1]<=16000) b2 = dpx[j+vx[i-1]][i-1];
            dpx[j][i] = b|b2;
        }
    }
    for(int i = 1; i <= vy.size(); i++){
        for(int j = 0; j <= 16000; j++){
            bool b = false, b2 = false;
            if(j-vy[i-1]>=0) b = dpy[j-vy[i-1]][i-1];
            if(j+vy[i-1]<=16000) b2 = dpy[j-vy[i-1]][i-1];
            dpy[j][i] = b|b2;
        }
    }
    bool flg;
    if(vx.size()==vy.size()) flg = dpx[8000+x][vx.size()]&&dpy[8000+y][vy.size()];
    else if(!vx.size()&&vy.size()) flg = (x==0)&&dpy[8000+y][vy.size()];
    else if(vx.size()&&!vy.size()) flg = dpx[8000+x][vx.size()]&&(y==0);
    else flg = (x==0)&&(y==0);

    if(flg) cout << "YES" << endl;
    else cout << "NO" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: conflicting declaration 'int s'
   16 |     int s = 0;
      |         ^
a.cc:13:12: note: previous declaration as 'std::string s'
   13 |     string s; cin >> s;
      |            ^
a.cc:22:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   22 |             s++;
      |             ~^~
a.cc:25:29: error: no matching function for call to 'std::vector<int>::push_back(std::string&)'
   25 |                 vx.push_back(s);
      |                 ~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:27:21: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   27 |                 s = 0;
      |                     ^
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
a.cc:29:29: error: no matching function for call to 'std::vector<int>::push_back(std::string&)'
   29 |                 vy.push_back(s);
      |                 ~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:30:21: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   30 |                 s = 0;
      |                     ^
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~