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 ...
随机推荐
- ios专题 - 委托模式实现
在ios中,委托模式非常常见,那委托模式是什么? 委托模式是把一个对象把请求给另一个对象处理. 下面见例子: #import <UIKit/UIKit.h> @protocol LQIPe ...
- html表单 第四节
实例: <html> <head> <title>表单实例</title> </head> <body> <center& ...
- e+开发中的各种问题
1.数据交换后走的查询公式还是controller所配置的公式
- NOSql之redis的学习
/** * 这里是我的虚拟机相关的启动命令 /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf /usr/local/r ...
- SQL优化(2)
建表时候数据库引擎的选择也可以达到优化的效果 InnoDB: 基于磁盘的资源是InnoDB表空间数据文件和它的日志文件,InnoDB 表的大小只受限于操作系统文件的大小,一般为 2GB MyISAM: ...
- H5 required 改变错误提示oninvalid、oninput、onforminput
<input type="text" name="password" oninvalid="this.setCustomValidity('XX ...
- C#语言特性-运算符重载
一.C#当中可以进行重载和不可重载的运算符: 1.简单的说明: 1.从上图中可以看到,可以重载的和不可以进行重载的运算符,比较特殊的是第二行和倒数第三行,的运算符,为什么会说它们特殊,是因为(第三行) ...
- Win7 + VS2015 + CMake3.6.1-GUI编译库
CMake生成Unicode版本VC工程 Just add this line in your top CMakeLists.txt file: add_definitions(-DUNICO ...
- 2016031401 - ubuntu显示桌面快捷键
ubuntu显示桌面快捷键设置 步骤如下:系统设置->键盘->快捷键->窗口->最小化窗口 个人设置的是super+D,super就是window下的win键.
- 要将表的限制条件写到与该表同级别的where中
测试目的:将朱查询的限制条件放到子查询的where中,查看性能影响. 测试数据:create table t1 as select object_id,object_name from dba_obj ...