2012年2月26日

poj 1195 Mobile phones 二维树状数组

摘要: 题意:n*n的矩阵定义两种操作:1 x y a 把(x,y)的权值加a2 l b r t 查询 子矩阵(l,b) ~(r,t) 的和思路:二维树状数组 1 #include<iostream> 2 using namespace std; 3 #define MAXN 1200 4 int tree[MAXN][MAXN]; 5 int n; 6 int lowbit(int x) 7 { 8 return x&(x^(x-1)); 9 }10 void update(int x,int y,int a)11 {12 for(int i=x;i<=n;i+=lowbi 阅读全文

posted @ 2012-02-26 09:48 myoi 阅读(195) 评论(0) 推荐(0) 编辑

导航