
树状数组
文章平均质量分 78
Phoebe201421085
这个作者很懒,什么都没留下…
展开
-
poj2481
#include #include #include #include #define MAX 100005using namespace std;struct cow{ int x,y,id;}a[MAX];int c[MAX],ans[MAX];bool cmp(cow a,cow b){ if (原创 2015-03-27 16:26:50 · 359 阅读 · 0 评论 -
codeforces 61E
Enemy is weaktime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Romans have attacked again. This time the原创 2015-03-27 18:58:43 · 512 阅读 · 0 评论 -
poj2299
#include #include #include #include #define MAX 500005using namespace std;struct node{ long long val; int pos;}a[MAX];int ans[MAX];int c[MAX];bool cmp1(原创 2015-03-27 18:03:26 · 337 阅读 · 0 评论 -
poj3067
#include #include #include #include #define MAX 1000010using namespace std;int c[MAX];int T,N,M,K;long long ans;struct road{ int x; int y;}a[MAX];bool原创 2015-03-22 17:14:02 · 329 阅读 · 0 评论 -
poj2352
数状数组:int lowbit(int x){ return x&(-x);}void add(int po,int val){ while (po { c[po]+=val; po+=lowbit(po); }}int getsum(int po){ int su原创 2015-03-22 16:36:11 · 274 阅读 · 0 评论