摘要: Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k. Example: The 阅读全文
posted @ 2016-07-17 21:51 ZHOU YANG 阅读(1220) 评论(0) 推荐(0) 编辑
摘要: lower_bound算法要求在已经按照非递减顺序排序的数组中找到第一个大于等于给定值key的那个数,其基本实现原理是二分查找,如下所示: upper_bound函数要求在按照非递减顺序排好序的数组中找到第一个大于给定值key的那个数,其基本实现原理是二分查找,具体实现如下所示: 上述两种实现参考了 阅读全文
posted @ 2016-07-17 17:53 ZHOU YANG 阅读(2944) 评论(0) 推荐(0) 编辑