摘要:
最大化最小值的问题。 方法一:直接做,顺便复习一下迭代器和lower_bound的用法。 方法二:分别计算每个house左面和右面距离最近的heater。时间复杂度比上述要低。学习一下 *max_element 和 *min_element 的用法。 阅读全文
posted @ 2018-05-31 17:21
約束の空
阅读(127)
评论(0)
推荐(0)
摘要:
class Solution { public: int findTargetSumWays(vector& nums, int S) { return cal(0,0,nums,S); } int cal(int index, int sum, vector &nums, int S){ if (index==nums.size... 阅读全文
posted @ 2018-05-31 00:37
約束の空
阅读(74)
评论(0)
推荐(0)

浙公网安备 33010602011771号