Super Jumping! Jumping! Jumping!

Super Jumping! Jumping! Jumping!详解(动态规划) 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... 阅读详情

题目:

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

 

题意:

有n个数字,下一个要选择的数字必须大于前面一个选择的数字,问能等到的最大数字和是多大?

 

思路:

求最大递增子串和,利用动态规划的思想;

 

代码:

#include<stdio.h>
int main()
{
    int n;
    while(~scanf("%d",&n)&&n)
    {
        int a[1100],dp[1100]= {0},maxx=-1;
        for(int i=1; i<=n; i++)
            scanf("%d",&a[i]);
        for(int i=1; i<=n; i++)
        {
            int sum=0;
            for(int j=1; j<i; j++)
            {
                if(a[j]<a[i])
                    if(dp[j]>sum)
                        sum=dp[j];
            }
            dp[i]=a[i]+sum;
            if(dp[i]>maxx)
                maxx=dp[i];
        }
        printf("%d\n",maxx);
    }
    return 0;
}

 

【SOFA】SOFA框架+Win10+VS2019 配置 SOFA (Simulation Open Framework Architecture)官网 SOFA 是一个开源的仿真框架,用于实时的物理仿真,而且主要针对医学上的仿真。主要用于研究人员开发新的算法,也可以作为一个有效的快速成型工具或是物理引擎。 官网中给出的配置方法写的很清晰,有着各个库或者软件的版本要求,仔细看按版本要求来 官网配置地址 官网给了两种方 1.通过脚本自动配置 2. 自己下载相关库通过CMake进行生成 第一种 没使用,不知道是否好使,因为如果其中有下载的东西,国内不一定能成功,大家可 阅读详情

相关推荐

Android Settings 设置Preference置灰显示

使Preference置灰显示,不能点击。先调用Preference的setEnabled(false),再调用setShouldDisableView(true); 如果使置灰项恢复正常可点击,可调用setEnabled(true)。

随风而动 1048

hdu 1087 Super Jumping! Jumping! Jumping! 【动规】

题目 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 consis

QYQHxyh的博客 258

显著性算法 + 伪彩变换

利用opencv得到显著图和伪彩图

正在挣扎中的人 2298

Super Jumping! Jumping! Jumping!(HDU-1087)

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 t...

Alex_McAvoy的博客 730

万象RK3506-EG1800网关使用说明

摘要:HD-RK3506-EG1800是一款高性能工业物联网边缘计算网关,支持Buildroot和Ubuntu双系统。文档详细介绍了网关的网络配置(包括ETH0/ETH1的静态IP设置、WiFi连接)、时钟同步、HSL软件安装配置(含开机自启动服务)、系统日志优化以及刷机操作指南(Loader/Maskrom模式)。特别提供了基于lighttpd的网页管理方案,通过HTML界面实现网络参数可视化配置,包含身份验证、实时状态显示和表单提交功能。网关默认ETH0固定IP为192.168.1.10,提供完整的CL

tian_jiangnan的博客 174

跟着团子学SAP CO:结果分析各评估方法计算逻辑概览 RA Valuation Method Overview KKA1/KKA2/KKA3

在大部分企业财务月结时,结果分析是必不可少的一环,通过结果分析系统可按照设定的评估方法及相关配置自动计算在制品(WIP)、主营业务成本、主营业务收入等等。 在结果分析中最重要的是根据业务需求选择合适的评估方法,目前SAP共提供15种评估方法,今天针对每一种方法计算逻辑及常用的业务场景进行介绍: (1)基于收入的评估方式(带利润实现) Revenue-Based Method with Profit Realization 第一种方式的计算是基于实际收入与计划收入的占比推算应结转的主营业务成本,如果当期累计的

Lucas1211的博客 1万+

Super Jumping! Jumping! Jumping!(DP 最长不下降子序列 )超详细题解

目录1.题目2.题意3.解题思路4.代码 1.题目 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 ...

林深不见鹿 的博客 1358

Matlab生成dsp程序——环境搭建(c2000系列[F28335、F2837x]都适用)

一、环境配置 (28377D的操作是一模一样就是硬件设置的时候需要选择28377d进行相应的设置) 1)matlab与ccs联合编译需要安装对应的matlab版本和ccs版本,且只有2016a以上的matlab支持c2000系列。具体对应关系参照: http://software-dl.ti.com/ccs/esd/documents/ccs_matlab.html 2)matlab版本确定之后,还需要安装有关于ccs的相关软件: I、TI Code Composer Studio xxxx(对应

qq_42151264的博客 2万+

Super Jumping! Jumping! Jumping!【暑期培训E题】【经典DP】

        说来这道题也是一个飞跃,我一定要详细的记录下来!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 introdu...

既然弱小,就只顾变强就是了 330

从原理图到PCB:基于Allegro的8槽PXIe背板高速设计实战

本文详细介绍了基于Allegro软件进行8槽PXIe背板高速设计的完整实战流程。从理解规范、原理图设计、PCB布局规划,到高速PCIe差分对与精密时钟的布线艺术,再到电源与地处理以及最终的设计验证与生产文件输出,系统性地阐述了确保背板信号完整性、电源完整性和系统稳定性的关键技术与工程实践。

weixin_28312391的博客 202

高通SA8295P音频接口深度解析:全面掌握SA8295P的LS-I2S、PCM/TDM与高性能音频处理技术设计

SA8295P提供丰富的音频接口选项,包括LS-I2S、PCM/TDM和HS-I2S接口,具备灵活的配置选项,适合各种高保真音频和高速数据传输应用。结合LS-I2S和PCM/TDM接口:在复杂的音频编解码器设计中,可结合使用LS-I2S和PCM/TDM接口,以处理和传输不同的音频数据流。使用HS-I2S接口:在软件定义无线电(SDR)系统中,高速I2S接口可处理高速数据流,如无线电信号的解码和处理。LS-I2S(低速I2S)接口是SA8295P的一部分,提供了丰富的音频数据传输选项。

weixin_43199439的博客 1403

Super Jumping! Jumping! Jumping! (非连续递增序列求和)

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 ...

薄荷糖 1422

红米k60 修复“NV损坏” 去除主板校验电阻步骤解析与图示

红米k60 基带代码:mondrian。搭载‌高通骁龙8+ Gen1处理器.国外版本称:POCO F5 Pro适用于以下型号的小米机型:23013RK75C, 23013PC75G。 💝💝💝通过博文了解 1💝💝💝-----此机型修复NV损坏硬件类操作主板图示 2💝💝💝-----了解设备出现NV损坏的底层逻辑 3💝💝💝 ------具体修改步骤

小马哥的专栏 391

HDU 【1087】Super Jumping! Jumping! Jumping

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 yo

进击的小白 207

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Hdoj 1087.Super Jumping! Jumping! Jumping!

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 t...

优快云2082的博客 176

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

hdu 1087 Super Jumping! Jumping! Jumping!(dp)

hdu 1087 Super Jumping! Jumping! Jumping! http://acm.hdu.edu.cn/showproblem.php?pid=1087 ProblemDescription Nowadays,akindofchessgamecalled“SuperJumping!Jumping!Jumping!”isv...

diansitao5461的博客 94

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

B - Super Jumping! Jumping! Jumping! HDU - 1087(dp)

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...

莉莉莉的博客 390

HDU - 1087 Super Jumping! Jumping! Jumping!

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 c...

GJLfly的博客 280

HDUOJ 1087 Super Jumping! Jumping! Jumping!

HDUOJ 1087 Super Jumping! Jumping! Jumping! 题目链接 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.

旺崽的博客 2688

F - Super Jumping! Jumping! Jumping!

题目: 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 ...

titi2018815的博客 243

HDU-1087 Super Jumping! Jumping! Jumping! (DP)

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 yo

robin_8的博客 305

hdu 1087 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): 22532    Accepted Submission(s): 9916 Problem Descrip

小张的专栏 416

Super Jumping! Jumping! Jumping! HDU - 1087

问题: 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 ...

lxxdong的博客 468
上一篇: Robot Rapping Results Report
下一篇: 二叉搜索树
admin__
博客等级 码龄8年 3粉丝 79原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值