- 选取两个操作数中的最小值,这样重合度最大;
int maxCount(int m, int n, vector<vector<int>>& ops) {
for (int i = 0; i < ops.size(); ++i) {
m = min(m, ops[i][0]);
n = min(n, ops[i][1]);
}
return m*n;
}
int maxCount(int m, int n, vector<vector<int>>& ops) {
for (int i = 0; i < ops.size(); ++i) {
m = min(m, ops[i][0]);
n = min(n, ops[i][1]);
}
return m*n;
}
本文标题:598. Range Addition II
本文链接:https://www.haomeiwen.com/subject/gxpwhftx.html
网友评论