树状数组
我要满满的AC
不积跬步,无以至千里
展开
-
poj2352 Stars 树状数组
小试牛刀。#include#include#define maxn 32005int level[maxn],c[maxn];int lowbit(int x){ return x&(-x);}int sum(int i){ int s=0; while(i) { s+=c[i]; i-=lowbit(i); } return s;}void add(i原创 2014-08-07 17:03:10 · 391 阅读 · 0 评论 -
HDU1166 敌兵步阵 树状数组
上次做这题用了线段树,这次写了树状数组。嗯,树原创 2014-08-07 17:21:13 · 326 阅读 · 0 评论 -
POJ1195 Mobile phones 二维数状数组
这题的重点是结合二维数组与原创 2014-08-07 21:46:49 · 469 阅读 · 0 评论 -
POJ3067 Japan 树状数组
这题有几个小地方值得注意一下。1.相交条件。shwy原创 2014-08-07 20:41:32 · 348 阅读 · 0 评论 -
SPOJ4201 Coder Ratings树状数组
在做这一题时,首先想到了树状o原创 2014-08-10 22:07:13 · 327 阅读 · 0 评论 -
第五周第二次训练 D题 树状数组
DescriptionGiven a sequence of N (1 ≤ N ≤ 10,000) integers S1, ..., SN (0 ≤ Si 1, ..., iK such that 1 ≤ i1 K ≤ N and Si1 iK.InputThe first line contains the two integers N and K. T原创 2014-08-12 16:18:47 · 315 阅读 · 0 评论