hdu - 1166 (树状数组模板)
#include<cstdio>#include<cstring>const int N = 50005;int d[N], num[N], n, x, y;char str[10];int lowbit(int x) { return -x & x;}void add(int i, int num) { while(i <= n) {...