> #include
using namespace std;
const int MAX=50005;
int a[MAX],tree[MAX],n;
int lowbit(int x) //找最低位的1
{
return x&-x;
}
void add(int i,int x)//修改数据在i加x
{
while(i0)
{
s+=tree[i];
i-=lowbit(i);
}
return s;
}
int main()
{
ios::sync_with_stdio(0);cin.tie(0);
}
例题
树