暴力搜索: public class Solution { public int search(int idx, int[] nums){ if(idx<0){ return 0; } return Math.max(nums[idx] + search(idx-2, nums), search(i ...
分类:
其他好文 时间:
2016-09-24 17:25:12
阅读次数:
148
先附上题目链接,有两问: https://leetcode.com/problems/house-robber/ https://leetcode.com/problems/house-robber-ii/ 第一问题目如下: You are a professional robber plannin ...
分类:
其他好文 时间:
2016-09-24 13:29:36
阅读次数:
183
There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a certai ...
分类:
其他好文 时间:
2016-09-22 09:52:03
阅读次数:
120
Apple Tree Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 26995 Accepted: 8007 Description There is an apple tree outside of kaka's house. ...
分类:
移动开发 时间:
2016-09-20 01:30:41
阅读次数:
230
Apple Tree Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 26989 Accepted: 8004 Description There is an apple tree outside of kaka's house. ...
分类:
移动开发 时间:
2016-09-18 23:56:48
阅读次数:
488
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5538 题意:有一个三维的图形,先给出平面图是n*m的矩形,每个位置都有不同个数的方块,a[i][j]代表当前位置有a[i][j]个方块,就是高度;现要求三维图形的表面积,方块的边长为1; 简单的水题,直 ...
分类:
其他好文 时间:
2016-09-16 16:49:14
阅读次数:
132
House Building Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1122 Accepted Submission(s): 689 ...
分类:
其他好文 时间:
2016-09-15 21:34:18
阅读次数:
115
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 ...
分类:
其他好文 时间:
2016-09-15 13:42:14
阅读次数:
136
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1100 Accepted Submission(s): 674 Problem Descri ...
分类:
其他好文 时间:
2016-09-13 22:14:16
阅读次数:
204
标签: 动态规划 题目描述: There are a row of n houses, each house can be painted with one of the k colors. The cost of painting each house with a certain color i ...
分类:
其他好文 时间:
2016-09-10 06:43:57
阅读次数:
237