一维前缀和
s[i] += s[i - 1];
一维差分
b[i] = a[i] - a[i - 1];
二维前缀和
a[i][j] = a[i - 1][j] + a[i][j - 1] -a[i - 1][j - 1] + b[i][j];
二维差分
//在ijij 处添加a[i][j];
//构造
b[x1][y1] += c;
b[x2 + 1][y1] -= c;
b[x1][y2 + 1] -= c;
b[x2 + 1][y2 + 1] += c;
//操作
//二维前缀和