1.题目要求You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopp...
分类:
其他好文 时间:
2015-04-04 15:01:51
阅读次数:
130
上原题:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stoppin...
分类:
其他好文 时间:
2015-04-03 23:41:42
阅读次数:
197
标题:House Robber通过率:27.5%难度:简单You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, th...
分类:
其他好文 时间:
2015-04-03 22:19:01
阅读次数:
155
这道题目应该在理解上会有一点问题。这道题的概率不是用来加的,而是用来乘的。这道题要的是在能逃跑的前提下,获得的最大money,而题目中给的概率是被抓的概率,所以要先有一个预处理,之后只要列出状态转移方程就可以轻松解决了:dp[i]=max{dp[i],dp[i-v[i]]*p[i]},注意初始条件,...
分类:
其他好文 时间:
2015-04-02 20:50:09
阅读次数:
132
1 题目You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stoppin...
分类:
其他好文 时间:
2015-04-02 20:46:19
阅读次数:
131
链接:https://leetcode.com/problems/house-robber/
这道理可以看做是状态压缩,每两个数字看做是一行,状态有3个,故需要F[N][3]的数组,F[i][j]就表示第i行状态j时rob的money。
具体状态压缩可以看我这两篇blog: 算法练习系列—hiho1048 状态压缩一(铺地砖) 算法练习系列—hiho1044 状态压缩二(捡垃圾)
#inc...
分类:
其他好文 时间:
2015-04-01 20:03:09
阅读次数:
166
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...
分类:
其他好文 时间:
2015-04-01 17:05:33
阅读次数:
114
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...
分类:
其他好文 时间:
2015-04-01 14:48:14
阅读次数:
110
public Map getInWareHouseReport(int i, int j, InWareHouse inWareHouse) { //查询分组后总条数 String countquery="select WS_SKU_ID,sum(IN_NUMBER),sum(WH_MONEY).....
分类:
数据库 时间:
2015-04-01 12:55:09
阅读次数:
229
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...
分类:
其他好文 时间:
2015-04-01 01:37:01
阅读次数:
94