传送门戳这里 Luogu & CodeForces 题目描述 Adilbek's house is located on a street which can be represented as the OX axis. This street is really dark, so Adilbek ...
分类:
其他好文 时间:
2018-07-02 21:38:12
阅读次数:
350
Description Emma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping ...
分类:
其他好文 时间:
2018-06-21 23:39:53
阅读次数:
263
你是一个专业的小偷,计划偷窃沿街的房屋。每间房内都藏有一定的现金,影响你偷窃的唯一制约因素就是相邻的房屋装有相互连通的防盗系统,如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警。 给定一个代表每个房屋存放金额的非负整数数组,计算你在不触动警报装置的情况下,能够偷窃到的最高金额。 示例 1: 输 ...
分类:
其他好文 时间:
2018-06-20 13:06:04
阅读次数:
252
题目如下: 解题思路:和【leetcode】198. House Robber 思路一样,也是动态规划。只不过本题新增了一个约束,就是nums[0]和nums[len(nums)-1]不能同时抢。那么我们可以分别针对nums[0]抢还是不抢这两种情况做两次动态规划。如果nums[0]抢的话,那么抢劫 ...
分类:
其他好文 时间:
2018-06-19 18:25:18
阅读次数:
123
八字真言:非空即真,非0即真 1、空 a=[] b='' c=() d=0 e=none 2、定义一个字典 字典是无序的,查询时会随机显示 字典是k-v形式的 3、新增 ① shenyang[‘女朋友’]=‘很漂亮’ ② shenyang.setdefault('house','10套') setd ...
分类:
编程语言 时间:
2018-06-07 14:14:52
阅读次数:
166
198. House Robbers I: 问题描述: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the ...
分类:
其他好文 时间:
2018-06-03 10:45:27
阅读次数:
138
最大化最小值的问题。 方法一:直接做,顺便复习一下迭代器和lower_bound的用法。 方法二:分别计算每个house左面和右面距离最近的heater。时间复杂度比上述要低。学习一下 *max_element 和 *min_element 的用法。 ...
分类:
其他好文 时间:
2018-05-31 19:15:34
阅读次数:
152
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo ...
分类:
其他好文 时间:
2018-05-30 00:22:16
阅读次数:
187
Deck at your house is not just extension of your living space; a good deck is indeed center of attraction of your house. Wood decks are exposed and ex ...
分类:
其他好文 时间:
2018-05-28 14:52:55
阅读次数:
204
Americans are accustomed to have decks in their houses. Decks add beauty and life to the exterior of a house. They symbolize the personality of the ho ...
分类:
其他好文 时间:
2018-05-28 14:45:28
阅读次数:
151