I want to range query a string using Fenwick tree. But something is going wrong with my code. Concatenation is giving error Eror is:[Error] no match for 'operator+=' (operand types are 'std::vector >' and 'std::string {aka std::basic_string}') Given a string s, I want to store the string in this fenwick tree. e.g. s=abcdef, on BIT it should like(top-bottom) a ab-c abcd-e abcd-ef Tree Structure
vector<string> BIT[100005];
int n;
void BI(int x,string c)
{
for(;x<=n;x+=x&-x)
{
BIT[x]+=c;
}
}
int main()
{
cin>>n;
string s;
for(int i=1;i<=n;i++)
{ cin>>s;
BI(i,s);
}
}