View Code #include<stdio.h>#include<string.h>#define max 100010 int b[max],c[max];__int64 x[max],y[max];int a[max];int lowbit(int x){ return x&(-x);}void update(int arr[],int x){ while(x<=max) { arr[x]++; x+=lowbit(x); }}__int64 sum(int arr[],int x){ __int64 ans=0; wh... Read More