2012年5月23日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3584裸三维树状数组。。。除了三维的容斥要稍微想一下别的都和一维、二维的一样了View Code #include <iostream>using namespace std;const int MAX=101;int n;int tree[MAX][MAX][MAX];int lowbit(int i){ return i&(-i);}void update(int x,int y,int z){ for(int i=x;i<=n;i+=lowbit(i)) for(int j=y 阅读全文
posted @ 2012-05-23 19:11 LegendaryAC 阅读(136) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2642裸二维树状数组,没有秒杀,坑点是这题的询问是x1,x2,y1,y2(其实题目说得清清楚楚,惯性思维害死人?写完不过sample无力吐槽)。然后犯了一个巨2的笔误,死活没查出来,还是让路人王同学看出来的、、、、跪了View Code #include <iostream>using namespace std;const int MAX=1010;int vis[MAX][MAX],tree[MAX][MAX];int lowbit(int i){ return i&(-i);}voi 阅读全文
posted @ 2012-05-23 13:12 LegendaryAC 阅读(255) 评论(0) 推荐(0) 编辑