HUD-1087(dp)

题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1087

大致题意:只能从小的往大的跳 求走过的和最大。

code:

/**
http://acm.hdu.edu.cn/showproblem.php?pid=1087
*/

#include 
#include 
#define maxn 1010
#define ll long long
using namespace std;
ll a[maxn],b[maxn];
int n;
int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    while(~scanf("%d",&n),n){
        for(int i=0;i

你可能感兴趣的:(acm_动态规划)