HDOJ --- Super Jumping! Jumping! Jumping!
Super Jumping! Jumping! Jumping!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 19996 Accepted Submission(s): 8679

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.
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.
DP 水题,暴力DP。
#include<iostream>
#include<cstdio>
#include<climits>
#include<cstring>
#define MAX 1111
using namespace std;
long long int dp[MAX], temp[MAX], ans;
int main(){
int n;
while(~scanf("%d", &n) && n){
memset(dp, , sizeof(dp));
ans = -;
for(int i = ;i <= n;i ++){
scanf("%lld", &temp[i]);
for(int j = ;j < i;j ++)
if(temp[i] > temp[j]) dp[i] = max(dp[j]+temp[i], dp[i]);
ans = max(ans, dp[i]);
}
printf("%lld\n", ans);
}
}
HDOJ --- Super Jumping! Jumping! Jumping!的更多相关文章
- HDU - 1087 Super Jumping!Jumping!Jumping!(dp求最长上升子序列的和)
传送门:HDU_1087 题意:现在要玩一个跳棋类游戏,有棋盘和棋子.从棋子st开始,跳到棋子en结束.跳动棋子的规则是下一个落脚的棋子的号码必须要大于当前棋子的号码.st的号是所有棋子中最小的,en ...
- HDOJ/HDU 1087 Super Jumping! Jumping! Jumping!(经典DP~)
Problem Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!&quo ...
- Hdoj 1087.Super Jumping! Jumping! Jumping!
Problem Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!&quo ...
- E - Super Jumping! Jumping! Jumping!
/* Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is very popula ...
- Super Jumping! Jumping! Jumping!
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. May ...
- DP专题训练之HDU 1087 Super Jumping!
Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is ve ...
- hdu 1087 Super Jumping! Jumping! Jumping! 简单的dp
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 ...
- Super Jumping! Jumping! Jumping!——E
E. Super Jumping! Jumping! Jumping! Time Limit: 1000ms Memory Limit: 32768KB 64-bit integer IO forma ...
- HDU 1087 Super Jumping! Jumping! Jumping! 最大递增子序列
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 ...
随机推荐
- css样式 第6节
程序员语录: 不要太刻意地把写程序这件事和挣钱挂起来,局限了你挣钱的本事 <html> <head> <title>网页样式</title> </ ...
- java连接远程服务器之manyged-ssh2 (windows和linux)
一.所需要的jar包 需要借助Ganymed SSH的jar包: ganymed-ssh2-262.jar 下载地址: http://www.ganymed.ethz.ch/ssh2/ API详情: ...
- Cogs 1008. 贪婪大陆(树状数组)
贪婪大陆 难度等级 ★★ 时间限制 1000 ms (1 s) 内存限制 128 MB 测试数据 10 简单对比 输入文件:greedisland.in 输出文件:greedisland.out 简单 ...
- 桥接模式(Bridge Pattern)
桥接模式,用于将抽象化与实现化解偶,使得二者可以独立变化. 举一个数据库JDBC的例子: 定义一个Driver接口,不同的数据库实现的接口,如MySQL,SQLServer public interf ...
- 挂载磁盘的问题(/dev/sdb1 is apparently in use by the system; will not make a 文件系统 here!)
用fdisk给新磁盘分区后.然后要创建文件系统 [root@cuizhipeng ~]# mkfs.ext4 /dev/sdb1mke2fs 1.41.12 (17-May-2010)/dev/sdb ...
- absolute之实现居中的三种方式
居中思想可以由很多方式实现,这篇文章采用absolute实现:由传统方式开始到absolute独立使用方式 方式一:传统方式,父容器relateive,子元素absolute,然后left:50%,再 ...
- 水晶报表显示到aspx页面中
1.在前台添加水晶报表显示控件. <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server&q ...
- 用C#实现MD5算法
/// <summary> /// 一个实现MD5散列字符串的类 /// </summary> public sealed class MD5Hash ...
- Spring Cloud App(Service) Pom示例
都配对了才能找到jar包(无法访问外网时是如何配的?) parent dependencyManageMent repositories plugInRepositories <groupId& ...
- 本博客css style
#navList { min-height: 60px; } #navList li { height: 60px; } #navList a { margin: 0px 5px !important ...