题目:有一个数字让你猜,你有k次机会,并且有k个保险如果猜的低了会高度你低了,
高了会告诉你高了,并且失去一k保险(k=0时猜高了就会失败),现在问你能猜的数字范围。
分析:dp,二维动态规划。按保险k和猜的机会n递增的方向dp。
状态:f(G,L)为有G次猜的机会,L个保险时确定的数字范围(1~N);
转移方程:F(...
分类:
其他好文 时间:
2014-09-26 02:35:38
阅读次数:
180
1.当在循环中遍历某一个值时,最好结合break、continue控制。List list=new ArrayList(5); list.add("one"); list.add("two"); list.add("three");遍历取值two:for(int i=0;i list=new Arr...
分类:
编程语言 时间:
2014-09-26 02:00:28
阅读次数:
231
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the larges...
分类:
其他好文 时间:
2014-09-26 01:16:58
阅读次数:
271
VLAN技术浅谈 http://www.h3c.com.cn/MiniSite/H3care_Club/Data_Center/Net_Reptile/The_One/Home/Catalog/200911/655250_97665_0.htm百度百科vlan http://baike.baidu....
分类:
数据库 时间:
2014-09-25 23:24:27
阅读次数:
400
1 //Accepted 804 KB 40 ms 2 //整个题,都是坑 3 //1.The first line of each data set contains exactly one integer n, 4 //1 9 #include 10 #include...
分类:
其他好文 时间:
2014-09-25 22:14:17
阅读次数:
260
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4283题解: 当最优解下, a1在j的位置排出, 则a2 ——aj-1 和 aj——an为两个独立事件, 状态转移方程: dp[i][i + j] = min(dp[i][i + j], dp[i + ....
分类:
其他好文 时间:
2014-09-25 21:41:37
阅读次数:
161
Problem:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transac...
分类:
其他好文 时间:
2014-09-25 21:10:47
阅读次数:
171
有时我们创建的托盘图标会无缘无故的消失了,搜索了下谷歌,发现是explorer.exe有时会记不住增加的托盘图标,当它记不住时,会发送消息询问窗口:有没有需要增加托盘图标的?然后你的窗口重新做一次增加托盘图标的动作即可。以下是原文:
When you’re a programmer, it seems like you learn something new every day. One o...
分类:
编程语言 时间:
2014-09-25 19:26:47
阅读次数:
293
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the...
分类:
其他好文 时间:
2014-09-25 15:11:49
阅读次数:
209
题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,...
分类:
编程语言 时间:
2014-09-25 13:26:28
阅读次数:
281