摘要:
##算法:子矩阵的和 核心公式: S[i, j] = 第i行j列格子左上部分所有元素的和 以(x1, y1)为左上角,(x2, y2)为右下角的子矩阵的和为: S[x2, y2] - S[x1 - 1, y2] - S[x2, y1 - 1] + S[x1 - 1, y1 - 1] 由图得,蓝色面积 阅读全文
posted @ 2022-11-25 11:15
csai_H
阅读(794)
评论(0)
推荐(0)
摘要:
##算法:前缀和 #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int a[N], s[N]; //s[N]前缀和数组 s[i] = a[1] + a[2] + a[3] + ...+ a[i] int m 阅读全文
posted @ 2022-11-25 10:58
csai_H
阅读(42)
评论(0)
推荐(0)

浙公网安备 33010602011771号