Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
vector<string> make_suffix_array(const &string s){
  vector<string> res;
  REP(i,(ll)s.size()+1){
    string tmp(s.begin()+i,s.end());
    res.push_back(tmp);
  }
  sort(ALL(res));
  return res;
}
int main(){//naive suffix array
  string t;
  int n;
  cin >> t >> n;
  auto suf = make_suffix_array(t);
  REP(i,n){
    string q;
    cin >> q;
    size_t sz = q.size();
    auto itr = lower_bound(ALL(suf),q);
    bool flag = false;
    do{
      if(itr==suf.end()) break;
      string cut(itr -> begin(),(itr->begin())+min(sz,itr->size()));
      if(cut==q){
        cout << 1 << endl;
        flag = true;
        break;
      } else if(cut > q){
        break;
      }
      ++itr;
    }while(true);
    if(!flag) cout << 0 << endl;
  }
}



Compiler output:
a.cc:21:41: error: ISO C++ forbids declaration of 'string' with no type [-fpermissive]
   21 | vector<string> make_suffix_array(const &string s){
      |                                         ^~~~~~
a.cc:21:48: error: expected ',' or '...' before 's'
   21 | vector<string> make_suffix_array(const &string s){
      |                                                ^
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > make_suffix_array(const int&)':
a.cc:22:16: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   22 |   vector<string> res;
      |                ^
a.cc:22:16: note:   expected a type, got 'string'
a.cc:22:16: error: template argument 2 is invalid
a.cc:23:13: error: 's' was not declared in this scope
   23 |   REP(i,(ll)s.size()+1){
      |             ^
a.cc:11:41: note: in definition of macro 'FOR'
   11 | #define FOR(i,a,b) for(ll i = (a); i < (b); i++)
      |                                         ^
a.cc:23:3: note: in expansion of macro 'REP'
   23 |   REP(i,(ll)s.size()+1){
      |   ^~~
a.cc:24:11: error: expected ';' before 'tmp'
   24 |     string tmp(s.begin()+i,s.end());
      |           ^~~~
      |           ;
a.cc:25:9: error: request for member 'push_back' in 'res', which is of non-class type 'int'
   25 |     res.push_back(tmp);
      |         ^~~~~~~~~
a.cc:25:19: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   25 |     res.push_back(tmp);
      |                   ^~~
      |                   tm
a.cc:13:24: error: request for member 'begin' in 'res', which is of non-class type 'int'
   13 | #define ALL(obj) (obj).begin(), (obj).end()
      |                        ^~~~~
a.cc:27:8: note: in expansion of macro 'ALL'
   27 |   sort(ALL(res));
      |        ^~~
a.cc:13:39: error: request for member 'end' in 'res', which is of non-class type 'int'
   13 | #define ALL(obj) (obj).begin(), (obj).end()
      |                                       ^~~
a.cc:27:8: note: in expansion of macro 'ALL'
   27 |   sort(ALL(res));
      |        ^~~
a.cc:28:10: error: could not convert 'res' from 'int' to 'std::vector<std::__cxx11::basic_string<char> >'
   28 |   return res;
      |          ^~~
      |          |
      |          int
a.cc: In function 'int main()':
a.cc:34:32: error: invalid initialization of reference of type 'const int&' from expression of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   34 |   auto suf = make_suffix_array(t);
      |                                ^
a.cc:21:41: note: in passing argument 1 of 'std::vector<std::__cxx11::basic_string<char> > make_suffix_array(const int&)'
   21 | vector<string> make_suffix_array(const &string s){
      |                                  ~~~~~~~^~~~~~