题目链接:poj 1195 Mobile phones
题目大意:四种操作
0 s:清空(1,1)~(s,s)
1 x y a:在(x,y)点加上a
2 x1 y1 x2 y2:询问矩形(x1,y1)~(x2,y2)的和。
3:结束
解题思路:纯二维树状数组。
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 1030;
#define lowbit(x) ((x)&(-x))
int fenw[maxn+5][maxn+5];
void add (int x, int y, int a) {
for (int i = x; i <= maxn; i += lowbit(i)) {
for (int j = y; j <= maxn; j += ......
阅读全文