题意:有一个整数序列,从中挑出一些数字,使得总和是最大,前提是,相邻的两个数字中只能挑其一。比如1 2 3 就只能挑2或者1和3。思路:很直观的题,dp思想。降低规模,从小规模开始考虑。如果只有两个数字,那么结果很明显就能知道是其中之大者。假如已经知道了第 i 个之前的决策,那么第i+2个之前的决策...
分类:
其他好文 时间:
2015-05-12 18:24:59
阅读次数:
115
用最多需要的香蕉数减去目标串出现的概率就行啦。。。。
如何求出现的概率?
每个字符出现的概率乘起来……再乘以目标串能摆的位置个数……
Problem
Your publishing house has decided to use monkeys randomly typing at keyboards to write great works of litera...
分类:
其他好文 时间:
2015-05-11 00:09:29
阅读次数:
280
Color the fence
时间限制:1000 ms | 内存限制:65535 KB
难度:2
描述
Tom has fallen in love with Mary. Now Tom wants to show his love and write a number on the fence opposite to
Mary’s house. Tom t...
分类:
其他好文 时间:
2015-05-08 22:13:29
阅读次数:
185
Problem DescriptionFred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he le...
分类:
其他好文 时间:
2015-05-08 14:24:43
阅读次数:
112
??
When you work with an architect to design a house, you start with three things: a list of wants (such as
“I want a house with three bedrooms”
and “I want to pay no more than
x”),
a ...
分类:
其他好文 时间:
2015-05-08 08:09:42
阅读次数:
193
题目: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...
分类:
其他好文 时间:
2015-05-07 14:11:44
阅读次数:
89
AMAZING AUCTION(这道麽。。。。英文题,,硬伤, 也是队友写的;题意是 从数据中找到与众不同的数据, 且该价钱是最低的(也就是竞标) 代码应该不难);题目描述Recently the auction house has introduced a new type of auction,...
分类:
其他好文 时间:
2015-05-04 19:29:55
阅读次数:
110
抢劫一排沿街的房子,每一家有不同的财富值,一夜之内抢了连续两家就会拉响报警。给出每家的财富值,求最多能抢到多少?【思路】动态规划求最优解。解题关键:递推式——maxV[i]=max{maxV[i-2]+nums[i], maxV[i-1]};【other code】int rob(vector& n...
分类:
其他好文 时间:
2015-05-04 10:00:19
阅读次数:
98
Apple Tree
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 20671
Accepted: 6257
Description
There is an apple tree outside of kaka's house. Every autumn,...
分类:
移动开发 时间:
2015-05-03 10:39:40
阅读次数:
164
iOS 证书分两种类型.第一种为$99美元的,这种账号有个人和公司的区别,公司账号能创建多个子账号,但个人的不能。这种账号可以用来上传app store第二种为¥299美元的,这种账号只能用于企业内部使用,不能用来上传app store .也就是常说的in-house证书(用这种证书打出来的包能在任...
分类:
移动开发 时间:
2015-05-01 10:40:28
阅读次数:
151