Language: C++

#include<bits/stdc++.h>
using namespace std;
#define MAX_N 1100000
int Rank[MAX_N],x[MAX_N];
int SA[MAX_N];char S[MAX_N],T[MAX_N];int V;
bool Compare(int p,int q){
	if(Rank[p]<Rank[q])return true;
	if(Rank[p]>Rank[q])return false;
	int D1=-1,D2=-1;
	if(p+V<=S.size())D1=Rank[p+V];
	if(q+V<=S.size())D2=Rank[q+V];
	if(D1<D2)return true;
	return false;
}
void Build(){
	int SSIZE=strlen(S);
	for(int i=0;i<SSIZE;i++){SA[i]=i;Rank[i]=S[i];}
	SA[SSIZE]=SSIZE;Rank[SSIZE]=-1;
	for(V=1;V<=SSIZE;V*=2){
		sort(SA,SA+SSIZE+1,Compare);
		x[SA[0]]=0;
		for(int i=1;i<=SSIZE;i++){
			x[SA[i]]=x[SA[i-1]]+Compare(SA[i-1],SA[i]);
		}
		for(int i=0;i<=S.size();i++)Rank[i]=x[i];
	}
}
int hantei(string &V1,string &V2){
	int H=min(V1.size(),V2.size());
	for(int i=0;i<H;i++){
		if(V1[i]<V2[i])return -1;
		if(V1[i]>V2[i])return 1;
	}
	return 0;
}
int main(){
	cin>>S;int Q;cin>>Q;
	for(int i=0;i<Q;i++){
		cin>>T;int L=0,R=S.size()+1,M;
		while(L+1<R){
			M=(L+R)/2;
			if(hantei(S+SA[M],T)<=0)L=M;
			else{R=M;}
		}
		if(hantei(S+SA[L],T)==0)cout<<"1"<<endl;
		else cout<<"0"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'bool Compare(int, int)':
a.cc:10:19: error: request for member 'size' in 'S', which is of non-class type 'char [1100000]'
   10 |         if(p+V<=S.size())D1=Rank[p+V];
      |                   ^~~~
a.cc:11:19: error: request for member 'size' in 'S', which is of non-class type 'char [1100000]'
   11 |         if(q+V<=S.size())D2=Rank[q+V];
      |                   ^~~~
a.cc: In function 'void Build()':
a.cc:25:34: error: request for member 'size' in 'S', which is of non-class type 'char [1100000]'
   25 |                 for(int i=0;i<=S.size();i++)Rank[i]=x[i];
      |                                  ^~~~
a.cc: In function 'int main()':
a.cc:39:36: error: request for member 'size' in 'S', which is of non-class type 'char [1100000]'
   39 |                 cin>>T;int L=0,R=S.size()+1,M;
      |                                    ^~~~
a.cc:41:25: error: 'M' was not declared in this scope
   41 |                         M=(L+R)/2;
      |                         ^
a.cc:45:28: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   45 |                 if(hantei(S+SA[L],T)==0)cout<<"1"<<endl;
      |                           ~^~~~~~
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,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:646:7: note:   after user-defined conversion: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with <template-parameter-2-1> = std::allocator<char>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  646 |       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
      |       ^~~~~~~~~~~~
a.cc:28:20: note:   initializing argument 1 of 'int hantei(std::string&, std::string&)'
   28 | int hantei(string &V1,string &V2){
      |            ~~~~~~~~^~