//求2^k
int lowbit(int t)
{
return t & ( t ^ ( t - 1 ) );
}
//求前n项和
int sum(int end)
{
long long sum = 0;
while(end > 0)
{
sum += am[end];
end -= lowbit(end);
}
return sum;
}
//增加某个元素的大小
void plus(int pos, int num)
{
while(pos <= n)
{
am[pos] += num;
pos += lowbit(pos);
}
}