Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef pair<int,int> pii;
typedef long long int ll;

#define INF 1 << 30
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)



vector<bool> gen_sosuu(vector<bool> sosuu){
  int size = sosuu.size();
  REP(i,size){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(size)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<size;j++){
      sosuu[i*j] =false;
    }
  }
  return sosuu;
}

string s;
int x,y;
int d = 0;//0がx,1がy
vector<int> cx;
vector<int> cy;

int dp[2][16010];

int main(){
  cin >> s>> x>>y;
    if(s[i]=='F'){
      int cnt = 0;
      while(s[i]=='F'){
        cnt++;
        i++;
      }
      i--;
      if(d == 0){
        cx.push_back(cnt);
      }else{
        cy.push_back(cnt);
      }
    }else{
      d = (d+1) % 2;
    }
  }
  dp[0][8005] = 1;
  dp[1][8005] = 1;
  REP(i,cx.size()){
    REP(j,16010){
      if(dp[0][j] == i+1){
        if(j-cx[i]>=0) dp[0][j-cx[i]] = i+2;
        if(j+cx[i]<16010) dp[0][j+cx[i]] = i+2;
      }
    }
  }
  REP(i,cy.size()){
    REP(j,16010){
      if(dp[1][j] == i+1){
        if(j-cy[i]>=0) dp[1][j-cy[i]] = i+2;
        if(j+cy[i]<16010) dp[1][j+cy[i]] = i+2;
      }
    }
  }
  if(dp[0][8005+x]==cx.size()+1 && dp[1][8005+y] == cy.size()+1){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:10: error: 'i' was not declared in this scope
   40 |     if(s[i]=='F'){
      |          ^
a.cc: At global scope:
a.cc:56:3: error: 'dp' does not name a type
   56 |   dp[0][8005] = 1;
      |   ^~
a.cc:57:3: error: 'dp' does not name a type
   57 |   dp[1][8005] = 1;
      |   ^~
a.cc:8:18: error: expected unqualified-id before 'for'
    8 | #define REP(i,n) for(ll i=0; i<(int)(n); i++)
      |                  ^~~
a.cc:58:3: note: in expansion of macro 'REP'
   58 |   REP(i,cx.size()){
      |   ^~~
a.cc:58:7: error: 'i' does not name a type
   58 |   REP(i,cx.size()){
      |       ^
a.cc:8:30: note: in definition of macro 'REP'
    8 | #define REP(i,n) for(ll i=0; i<(int)(n); i++)
      |                              ^
a.cc:58:7: error: 'i' does not name a type
   58 |   REP(i,cx.size()){
      |       ^
a.cc:8:42: note: in definition of macro 'REP'
    8 | #define REP(i,n) for(ll i=0; i<(int)(n); i++)
      |                                          ^
a.cc:8:18: error: expected unqualified-id before 'for'
    8 | #define REP(i,n) for(ll i=0; i<(int)(n); i++)
      |                  ^~~
a.cc:66:3: note: in expansion of macro 'REP'
   66 |   REP(i,cy.size()){
      |   ^~~
a.cc:66:7: error: 'i' does not name a type
   66 |   REP(i,cy.size()){
      |       ^
a.cc:8:30: note: in definition of macro 'REP'
    8 | #define REP(i,n) for(ll i=0; i<(int)(n); i++)
      |                              ^
a.cc:66:7: error: 'i' does not name a type
   66 |   REP(i,cy.size()){
      |       ^
a.cc:8:42: note: in definition of macro 'REP'
    8 | #define REP(i,n) for(ll i=0; i<(int)(n); i++)
      |                                          ^
a.cc:74:3: error: expected unqualified-id before 'if'
   74 |   if(dp[0][8005+x]==cx.size()+1 && dp[1][8005+y] == cy.size()+1){
      |   ^~
a.cc:76:4: error: expected unqualified-id before 'else'
   76 |   }else{
      |    ^~~~
a.cc:79:1: error: expected declaration before '}' token
   79 | }
      | ^