A-Apple Catching(POJ 2385)】的更多相关文章

牛如何吃苹果 问题大意:一个叫Bessie的牛,可以吃苹果,然后有两棵树,树上苹果每分钟会掉一个,这只牛一分钟可以在两棵树中往返吃苹果(且不吃地上的),然后折返只能是有限次W,问你这只叫Bessie的牛最多可以吃到多少个苹果 首先我们应该很容易想到,这个必须要用DP去做,然后就是考虑怎么储存旧值的问题了,因为树有两棵,然后每个往返状态对应不同的结果,所以我们应该用一个二维矩阵去储存(苹果的个数就不重要了,因为我们只用算到最后,前面的都可以扔掉). 然后状态方程应该怎么写呢?也很简单,定义一个状态…
Description 有两棵APP树,编号为1,2.每一秒,这两棵APP树中的其中一棵会掉一个APP.每一秒,你可以选择在当前APP树下接APP,或者迅速移动到另外一棵APP树下接APP(移动时间可以忽略不计),但由于却乏锻炼,你最多移动W次.问在T秒内,你最多能收集多少个APP.假设你开始站在1号APP树下. Input 第1行:两个整数T(1 < = T< = 1000)和W(1 < = W< = 30)第2..T+1行:1或2,代表每分钟掉落APP的那棵树的编号 Outpu…
Apple Catching Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8759   Accepted: 4264 Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, eac…
Apple Catching Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9978   Accepted: 4839 Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, eac…
Apple Catching   Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of apples. Bessie cannot reach the apples when they are on the tree, so sh…
Apple Catching Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13447   Accepted: 6549 Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, ea…
Apple Catching 直接翻译了 Descriptions 有两棵APP树,编号为1,2.每一秒,这两棵APP树中的其中一棵会掉一个APP.每一秒,你可以选择在当前APP树下接APP,或者迅速移动到另外一棵APP树下接APP(移动时间可以忽略不计),但由于却乏锻炼,你最多移动W次.问在T秒内,你最多能收集多少个APP.假设你开始站在1号APP树下. Input 第1行:两个整数T(1 < = T< = 1000)和W(1 < = W< = 30)第2..T+1行:1或2,代…
poj 2385 Apple Catching Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 14007   Accepted: 6838 Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his…
Apple Catching Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9831   Accepted: 4779 Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, eac…
dp dp( x , k ) = max( dp( x - 1 , k - 1 ) + *** , dp( x - 1 , k ) + *** ) *** = 0 or 1 ,根据情况 (BZOJ 1750双倍经验) ------------------------------------------------------------------------ #include<cstdio> #include<cstring> #include<algorithm>…