我想使用 Fenwick 树对字符串进行范围查询。但是我的代码出了点问题。连接给出错误 Eror is:[Error] no match for 'operator+=' (operand types are 'std::vector >' and 'std::string {aka std::basic_string}') 给定一个字符串 s,我想要将字符串存储在这棵芬威克树中。例如 s=abcdef,在 BIT 上它应该像(上-下)a ab-c abcd-e abcd-ef 树结构
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);
}
}