线段树做法http://www.cnblogs.com/wuyiqi/archive/2011/12/21/2295391.html从后往前操作View Code #include<cstdio>#include<cstring>const int maxn = 80001;int a[maxn],c[maxn],ans[maxn],n;int lowbit(int x){ return x&-x;}void update(int x,int d){ for(;x<maxn;x+=lowbit(x)) c[x]+=d;}int sum(int x){ in Read More
posted @ 2012-01-10 12:56 Because Of You Views(237) Comments(0) Diggs(0) Edit