博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 1087 Super Jumping! Jumping! Jumping! (DP)
阅读量:6418 次
发布时间:2019-06-23

本文共 2408 字,大约阅读时间需要 8 分钟。

Super Jumping! Jumping! Jumping!

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 20485    Accepted Submission(s): 8927

Problem Description
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.
The game can be played by two or more than two players. It consists of a chessboard(棋盘)and some chessmen(棋子), and all chessmen are marked by a positive integer or “start” or “end”. The player starts from start-point and must jumps into end-point finally. In the course of jumping, the player will visit the chessmen in the path, but everyone must jumps from one chessman to another absolutely bigger (you can assume start-point is a minimum and end-point is a maximum.). And all players cannot go backwards. One jumping can go from a chessman to next, also can go across many chessmen, and even you can straightly get to end-point from start-point. Of course you get zero point in this situation. A player is a winner if and only if he can get a bigger score according to his jumping solution. Note that your score comes from the sum of value on the chessmen in you jumping path.
Your task is to output the maximum value according to the given chessmen list.
 

 

Input
Input contains multiple test cases. Each test case is described in a line as follow:
N value_1 value_2 …value_N 
It is guarantied that N is not more than 1000 and all value_i are in the range of 32-int.
A test case starting with 0 terminates the input and this test case is not to be processed.
 

 

Output
For each case, print the maximum according to rules, and one line one case.
 

 

Sample Input
3
1 3 2
4
1 2 3 4
4
3 3 2 1
0
 

 

Sample Output
4
10
3
 

 

Author
lcy
 

 

Recommend
We have carefully selected several similar problems for you:            
 

 简单DP:O(n*n)

1 //15 MS    252 KB    Visual C++ 2 #include
3 #include
4 __int64 dp[1005]; 5 inline __int64 Max(__int64 a,__int64 b) 6 { 7 return a>b?a:b; 8 } 9 int main(void)10 {11 int n;12 __int64 a[1005];13 while(scanf("%d",&n),n)14 {15 memset(dp,0,sizeof(dp));16 __int64 maxn=0;17 for(int i=1;i<=n;i++){18 scanf("%I64d",&a[i]);19 }20 for(int i=1;i<=n;i++){21 for(int j=1;j

 

转载于:https://www.cnblogs.com/GO-NO-1/p/3684331.html

你可能感兴趣的文章
Linux查找文件的相关命令
查看>>
FastDFS 集群 安装 配置
查看>>
pyhon学习<文件操作>
查看>>
导航下拉菜单
查看>>
TSS 任务状态段 详解
查看>>
【二项式定理】【推导】计蒜客17115 2017 ACM-ICPC 亚洲区(西安赛区)网络赛 B. Coin...
查看>>
【并查集】bzoj1015 [JSOI2008]星球大战starwar
查看>>
ehCache+spring的简单实用
查看>>
纯CSS3代码实现表格奇偶行异色,鼠标悬浮变色
查看>>
这一周吃什么呢?
查看>>
文本聚类
查看>>
spring mvc改造成spring boot
查看>>
【学习/模板】tarjan缩点
查看>>
multiprocessor(下)
查看>>
Pyinstaller打包程序为*.exe
查看>>
MyBatis配置详解
查看>>
css的再深入8(更新中···)
查看>>
安卓新导入工程中gen目录下无R文件解决方法
查看>>
POJ 2245 Addition Chains(算竞进阶习题)
查看>>
时间分割与获取一下阶段时间
查看>>