Language: C++

/*
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
*       Example:-   $ g++ -std=c++11 c++Template.cpp
*
* Author : Akshay Pratap Singh
* Handle: code_crack_01
*
*/
 
/********   All Required Header Files ********/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

using namespace std;

/*******  All Required define Pre-Processors and typedef Constants *******/
#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD(t) scanf("%lld",&t)
#define SCC(t) scanf("%c",&t)
#define SCS(t) scanf("%s",t)
#define SCF(t) scanf("%f",&t)
#define SCLF(t) scanf("%lf",&t)
#define MEM(a, b) memset(a, (b), sizeof(a))
#define FOR(i, j, k, in) for(int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for(int i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert( B <= A && A <= C)
#define MP make_pair
#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define read(type) readInt<type>()
typedef long long int ll;
typedef unsigned long long int  ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<ll> vll;
typedef vector<vi> vvi;
#include "../template.hpp"

int main(){

  string s; cin >> s;
  int dest_x, dest_y; cin >> dest_x >> dest_y;

  vi x, y;
  int f_count = 0;
  int direction = 1;
  bool is_first_x_moved = true;

  REP(i, s.size()){
    if ( s[i] == 'F' ){
      f_count++;
    } else if ( s[i] == 'T' ){
      if( x.size() == 0 and direction == -1 ) is_first_x_moved = false;
      if( f_count > 0 ){
        if( direction > 0 ){
          x.push_back(f_count);
        } else {
          y.push_back(f_count);
        }
      }
      direction *= -1;
      f_count = 0;
    }
  }
 
  if( f_count > 0 ){
    if( direction > 0 ){
      x.push_back(f_count);
    } else {
      y.push_back(f_count);
    }
  }

  set<int> dpx, dpy;
  dpx.insert(0);
  dpy.insert(0);
  if( x.size()>0 and is_first_x_moved ) {dpx.clear(); dpx.insert(x[0]); }

  for(int i=0; i<x.size(); ++i){
    if( is_first_x_moved ) ++i;
    auto buf = dpx;
    dpx.clear();
    for(auto e : buf){
      dpx.insert(e+x[i]);
      dpx.insert(e-x[i]);
    }
  }

  for(int i=0; i<y.size(); ++i){
    auto buf = dpy;
    dpy.clear();
    for(auto e : buf){
      dpy.insert(e+y[i]);
      dpy.insert(e-y[i]);
    }
  }

  if( dpx.count(dest_x)>0 and dpy.count(dest_y)>0 ){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;

}



Compiler output:
a.cc:69:10: fatal error: ../template.hpp: No such file or directory
   69 | #include "../template.hpp"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.